3 test_description
='test combined/stat/moved interaction'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 TEST_PASSES_SANITIZE_LEAK
=true
10 # This test covers a weird 3-way interaction between "--cc -p", which will run
11 # the combined diff code, along with "--stat", which will be computed as a
12 # first-parent stat during the combined diff, and "--color-moved", which
13 # enables the emitted_symbols list to store the diff in memory.
15 test_expect_success
'set up history with a merge' '
18 git checkout -b side HEAD^ &&
20 git merge -m M main &&
24 test_expect_success
'log --cc -p --stat --color-moved' '
29 1 file changed, 1 insertion(+)
31 diff --git a/D.t b/D.t
33 index 0000000..$(git rev-parse --short D:D.t)
41 1 file changed, 1 insertion(+)
45 1 file changed, 1 insertion(+)
47 diff --git a/C.t b/C.t
49 index 0000000..$(git rev-parse --short C:C.t)
57 1 file changed, 1 insertion(+)
59 diff --git a/B.t b/B.t
61 index 0000000..$(git rev-parse --short B:B.t)
69 1 file changed, 1 insertion(+)
71 diff --git a/A.t b/A.t
73 index 0000000..$(git rev-parse --short A:A.t)
79 git log --format="commit %s" --cc -p --stat --color-moved >actual &&
80 test_cmp expect actual