Use "git merge" instead of "git pull ."
[gitweb.git] / line-log.c
index 52348796c1b482c06f8944999603a5b92dcfdf04..c2d01dccc2a12a767c442de58ed78df130699d74 100644 (file)
@@ -115,6 +115,8 @@ static void sort_and_merge_range_set(struct range_set *rs)
        qsort(rs->ranges, rs->nr, sizeof(struct range), range_cmp);
 
        for (i = 0; i < rs->nr; i++) {
+               if (rs->ranges[i].start == rs->ranges[i].end)
+                       continue;
                if (o > 0 && rs->ranges[i].start <= rs->ranges[o-1].end) {
                        if (rs->ranges[o-1].end < rs->ranges[i].end)
                                rs->ranges[o-1].end = rs->ranges[i].end;
@@ -297,6 +299,7 @@ static void line_log_data_insert(struct line_log_data **list,
        p = xcalloc(1, sizeof(struct line_log_data));
        p->path = path;
        range_set_append(&p->ranges, begin, end);
+       sort_and_merge_range_set(&p->ranges);
        if (ip) {
                p->next = ip->next;
                ip->next = p;