t2200: test more cases of "add -u"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Nov 11, 2007 at 18:44 UTC
25487bde2ab756a423489fc942b37c1550555b93
1 file changed
+28
-2
t/t2200-add-update.sh
+28
-2
@@ -1,6 +1,6 @@
1
#!/bin/sh
2
3
-test_description='git add -u with path limiting
3
+test_description='git add -u
4
5
This test creates a working tree state with three files:
6
@@ -9,7 +9,10 @@ This test creates a working tree state with three files:
9
dir/other (untracked)
10
11
and issues a git add -u with path limiting on "dir" to add
12
-only the updates to dir/sub.'
12
+only the updates to dir/sub.
13
+
14
+Also tested are "git add -u" without limiting, and "git add -u"
15
+without contents changes.'
16
17
. ./test-lib.sh
18
@@ -85,4 +88,27 @@ test_expect_success 'replace a file with a symlink' '
88
89
'
90
91
+test_expect_success 'add everything changed' '
92
+
93
+ git add -u &&
94
+ test -z "$(git diff-files)"
95
+
96
+'
97
+
98
+test_expect_success 'touch and then add -u' '
99
+
100
+ touch check &&
101
+ git add -u &&
102
+ test -z "$(git diff-files)"
103
+
104
+'
105
+
106
+test_expect_success 'touch and then add explicitly' '
107
+
108
+ touch check &&
109
+ git add check &&
110
+ test -z "$(git diff-files)"
111
+
112
+'
113
+
114
test_done