summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--line-log.c3
-rwxr-xr-xt/t4211-line-log.sh5
2 files changed, 8 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));
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 7369d3c517..0901b30982 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -94,4 +94,9 @@ test_expect_success '-L ,Y (Y == nlines + 2)' '
test_must_fail 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