Skip to content

Commit 25487bd

Browse files
committed
t2200: test more cases of "add -u"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent fb63d7f commit 25487bd

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

t/t2200-add-update.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
test_description='git add -u with path limiting
3+
test_description='git add -u
44
55
This test creates a working tree state with three files:
66
@@ -9,7 +9,10 @@ This test creates a working tree state with three files:
99
dir/other (untracked)
1010
1111
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.'
1316

1417
. ./test-lib.sh
1518

@@ -85,4 +88,27 @@ test_expect_success 'replace a file with a symlink' '
8588
8689
'
8790

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+
88114
test_done

0 commit comments

Comments
 (0)