Merge branch 'js/rebase-i-root-fix'
[alt-git.git] / t / t8009-blame-vs-topicbranches.sh
blob72596e38b25f65fc52da2a94cf0f453636e8f66c
1 #!/bin/sh
3 test_description='blaming trough history with topic branches'
4 . ./test-lib.sh
6 # Creates the history shown below. '*'s mark the first parent in the merges.
7 # The only line of file.t is changed in commit B2
9 # +---C1
10 # / \
11 # A0--A1--*A2--*A3
12 # \ /
13 # B1-B2
15 test_expect_success setup '
16 test_commit A0 file.t line0 &&
17 test_commit A1 &&
18 git reset --hard A0 &&
19 test_commit B1 &&
20 test_commit B2 file.t line0changed &&
21 git reset --hard A1 &&
22 test_merge A2 B2 &&
23 git reset --hard A1 &&
24 test_commit C1 &&
25 git reset --hard A2 &&
26 test_merge A3 C1
29 test_expect_success 'blame --reverse --first-parent finds A1' '
30 git blame --porcelain --reverse --first-parent A0..A3 -- file.t >actual_full &&
31 head -n 1 <actual_full | sed -e "s/ .*//" >actual &&
32 git rev-parse A1 >expect &&
33 test_cmp expect actual
36 test_done