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
This commit is contained in:
Junio C Hamano
2014-11-06 10:52:36 -08:00
2 changed files with 8 additions and 0 deletions

View File

@ -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));