Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-26 15:08:45 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-29 06:42:27 +0300
commit8fc8f05cef9b5a60cc7adbd5cd6ed130a89ca4e1 (patch)
tree719211f993b11d774be69dc2a448a91c1a8e2691 /t/t2203-add-intent.sh
parent0231ae71d3d6706183777fbfd91667d620776e87 (diff)
t2203: add a test about "diff HEAD" case
Previous attempts to fix ita-related diffs breaks this case. To make sure that does not happen again, add a test to verify the behavior wrt. ita entries when we diff a worktree and a tree. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2203-add-intent.sh')
-rwxr-xr-xt/t2203-add-intent.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 1115347712..546fead6ad 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -245,4 +245,21 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
test_cmp expected2 actual2
'
+test_expect_success '"diff HEAD" includes ita as new files' '
+ git reset --hard &&
+ echo new >new-ita &&
+ git add -N new-ita &&
+ git diff HEAD >actual &&
+ cat >expected <<-\EOF &&
+ diff --git a/new-ita b/new-ita
+ new file mode 100644
+ index 0000000..3e75765
+ --- /dev/null
+ +++ b/new-ita
+ @@ -0,0 +1 @@
+ +new
+ EOF
+ test_cmp expected actual
+'
+
test_done