diff options
-rw-r--r-- | line-log.c | 3 | ||||
-rwxr-xr-x | t/t4211-line-log.sh | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/line-log.c b/line-log.c index c2d01dccc2..fe04c9d109 100644 --- a/line-log.c +++ b/line-log.c @@ -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)); diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 7665d6785c..3be25a3a7f 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -77,4 +77,9 @@ test_expect_success '-L {empty-range} (first -L)' ' git log -L$n:b.c ' +test_expect_success '-L with --first-parent and a merge' ' + git checkout parallel-change && + git log --first-parent -L 1,1:b.c +' + test_done |