summaryrefslogtreecommitdiff
path: root/t/t4066-diff-emit-delay.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:17 (GMT)
commit5d2710bd3c706c3375991972b630f9419551f24e (patch)
tree8f50b388a223e1f63c8624fc9d4dfbc23f0b069d /t/t4066-diff-emit-delay.sh
parent5ad3550f026d7ea1b96e699fdf072b642e8a4b8b (diff)
parentdac03b5518a053e52ed7ee20925970728d3ae4c3 (diff)
downloadgit-5d2710bd3c706c3375991972b630f9419551f24e.zip
git-5d2710bd3c706c3375991972b630f9419551f24e.tar.gz
git-5d2710bd3c706c3375991972b630f9419551f24e.tar.bz2
Merge branch 'jk/diff-cc-stat-fixes'
"git diff --color-moved --cc --stat -p" did not work well due to funny interaction between a bug in color-moved and the rest, which has been fixed. * jk/diff-cc-stat-fixes: combine-diff: treat --dirstat like --stat combine-diff: treat --summary like --stat combine-diff: treat --shortstat like --stat combine-diff: factor out stat-format mask diff: clear emitted_symbols flag after use t4006: resurrect commented-out tests
Diffstat (limited to 't/t4066-diff-emit-delay.sh')
-rwxr-xr-xt/t4066-diff-emit-delay.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh
new file mode 100755
index 0000000..5df6b5e
--- /dev/null
+++ b/t/t4066-diff-emit-delay.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+test_description='test combined/stat/moved interaction'
+. ./test-lib.sh
+
+# This test covers a weird 3-way interaction between "--cc -p", which will run
+# the combined diff code, along with "--stat", which will be computed as a
+# first-parent stat during the combined diff, and "--color-moved", which
+# enables the emitted_symbols list to store the diff in memory.
+
+test_expect_success 'set up history with a merge' '
+ test_commit A &&
+ test_commit B &&
+ git checkout -b side HEAD^ &&
+ test_commit C &&
+ git merge -m M master &&
+ test_commit D
+'
+
+test_expect_success 'log --cc -p --stat --color-moved' '
+ cat >expect <<-\EOF &&
+ commit D
+ ---
+ D.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+ diff --git a/D.t b/D.t
+ new file mode 100644
+ index 0000000..1784810
+ --- /dev/null
+ +++ b/D.t
+ @@ -0,0 +1 @@
+ +D
+ commit M
+
+ B.t | 1 +
+ 1 file changed, 1 insertion(+)
+ commit C
+ ---
+ C.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+ diff --git a/C.t b/C.t
+ new file mode 100644
+ index 0000000..3cc58df
+ --- /dev/null
+ +++ b/C.t
+ @@ -0,0 +1 @@
+ +C
+ commit B
+ ---
+ B.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+ diff --git a/B.t b/B.t
+ new file mode 100644
+ index 0000000..223b783
+ --- /dev/null
+ +++ b/B.t
+ @@ -0,0 +1 @@
+ +B
+ commit A
+ ---
+ A.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+ diff --git a/A.t b/A.t
+ new file mode 100644
+ index 0000000..f70f10e
+ --- /dev/null
+ +++ b/A.t
+ @@ -0,0 +1 @@
+ +A
+ EOF
+ git log --format="commit %s" --cc -p --stat --color-moved >actual &&
+ test_cmp expect actual
+'
+
+test_done