]> git.ipfire.org Git - thirdparty/git.git/blobdiff - line-log.c
line-log: fix crash when --first-parent is used
[thirdparty/git.git] / line-log.c
index c2d01dccc2a12a767c442de58ed78df130699d74..fe04c9d109e682145e6b761f7f2de27779cf76a2 100644 (file)
@@ -1164,6 +1164,9 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm
        int i;
        int nparents = count_parents(commit);
 
+       if (nparents > 1 && rev->first_parent_only)
+               nparents = 1;
+
        diffqueues = xmalloc(nparents * sizeof(*diffqueues));
        cand = xmalloc(nparents * sizeof(*cand));
        parents = xmalloc(nparents * sizeof(*parents));