Merge branch 'en/merge-directory-renames-fix'
[git/raj.git] / t / t4066-diff-emit-delay.sh
blob5df6b5e64e0e76e776c337c985dcc1846dc40408
1 #!/bin/sh
3 test_description='test combined/stat/moved interaction'
4 . ./test-lib.sh
6 # This test covers a weird 3-way interaction between "--cc -p", which will run
7 # the combined diff code, along with "--stat", which will be computed as a
8 # first-parent stat during the combined diff, and "--color-moved", which
9 # enables the emitted_symbols list to store the diff in memory.
11 test_expect_success 'set up history with a merge' '
12 test_commit A &&
13 test_commit B &&
14 git checkout -b side HEAD^ &&
15 test_commit C &&
16 git merge -m M master &&
17 test_commit D
20 test_expect_success 'log --cc -p --stat --color-moved' '
21 cat >expect <<-\EOF &&
22 commit D
23 ---
24 D.t | 1 +
25 1 file changed, 1 insertion(+)
27 diff --git a/D.t b/D.t
28 new file mode 100644
29 index 0000000..1784810
30 --- /dev/null
31 +++ b/D.t
32 @@ -0,0 +1 @@
34 commit M
36 B.t | 1 +
37 1 file changed, 1 insertion(+)
38 commit C
39 ---
40 C.t | 1 +
41 1 file changed, 1 insertion(+)
43 diff --git a/C.t b/C.t
44 new file mode 100644
45 index 0000000..3cc58df
46 --- /dev/null
47 +++ b/C.t
48 @@ -0,0 +1 @@
50 commit B
51 ---
52 B.t | 1 +
53 1 file changed, 1 insertion(+)
55 diff --git a/B.t b/B.t
56 new file mode 100644
57 index 0000000..223b783
58 --- /dev/null
59 +++ b/B.t
60 @@ -0,0 +1 @@
62 commit A
63 ---
64 A.t | 1 +
65 1 file changed, 1 insertion(+)
67 diff --git a/A.t b/A.t
68 new file mode 100644
69 index 0000000..f70f10e
70 --- /dev/null
71 +++ b/A.t
72 @@ -0,0 +1 @@
74 EOF
75 git log --format="commit %s" --cc -p --stat --color-moved >actual &&
76 test_cmp expect actual
79 test_done