summaryrefslogtreecommitdiffstats
path: root/line-log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-11-06 19:52:36 +0100
committerJunio C Hamano <gitster@pobox.com>2014-11-06 19:52:37 +0100
commit64b9326460e066a6ae598ed53f38bec8ab4e577d (patch)
treeb93c89853841a3adf7d7b29f30297ba0cffe1ea4 /line-log.c
parentMerge branch 'jk/fetch-reflog-df-conflict' (diff)
parentline-log: fix crash when --first-parent is used (diff)
downloadgit-64b9326460e066a6ae598ed53f38bec8ab4e577d.tar.xz
git-64b9326460e066a6ae598ed53f38bec8ab4e577d.zip
Merge branch 'tm/line-log-first-parent'
"git log --first-parent -L..." used to crash. * tm/line-log-first-parent: line-log: fix crash when --first-parent is used
Diffstat (limited to 'line-log.c')
-rw-r--r--line-log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/line-log.c b/line-log.c
index 038c58a395..b7864ad586 100644
--- a/line-log.c
+++ b/line-log.c
@@ -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));