t9801: check git-p4's branch detection with client spec enabled
[gitweb.git] / line-log.c
index 1008e722584c882ac86b936307ace701b9225aaf..b7864ad5869eb076e778c352e2f64666dc77a525 100644 (file)
@@ -533,7 +533,7 @@ static void fill_line_ends(struct diff_filespec *spec, long *lines,
        }
 
        /* shrink the array to fit the elements */
-       ends = xrealloc(ends, cur * sizeof(*ends));
+       REALLOC_ARRAY(ends, cur);
        *lines = cur-1;
        *line_ends = ends;
 }
@@ -1141,6 +1141,9 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm
        int i;
        int nparents = commit_list_count(commit->parents);
 
+       if (nparents > 1 && rev->first_parent_only)
+               nparents = 1;
+
        diffqueues = xmalloc(nparents * sizeof(*diffqueues));
        cand = xmalloc(nparents * sizeof(*cand));
        parents = xmalloc(nparents * sizeof(*parents));