blame: allow blame --reverse --first-parent when it makes sense

Allow combining --reverse and --first-parent if initial commit of
specified range is at the first-parent chain starting from the final
commit. Disable the prepare_revision_walk()'s builtin children
collection, instead picking only the ones which are along the first
parent chain.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Max Kirillov
2015-10-30 07:01:53 +02:00
committed by Junio C Hamano
parent 1b0d40000a
commit 700fd28e4f
2 changed files with 31 additions and 3 deletions

View File

@ -26,7 +26,7 @@ test_expect_success setup '
test_merge A3 C1
'
test_expect_failure 'blame --reverse --first-parent finds A1' '
test_expect_success 'blame --reverse --first-parent finds A1' '
git blame --porcelain --reverse --first-parent A0..A3 -- file.t >actual_full &&
head -n 1 <actual_full | sed -e "s/ .*//" >actual &&
git rev-parse A1 >expect &&