Skip to content

Commit d51fac5

Browse files
raalkmlJunio C Hamano
authored andcommitted
workaround fat/ntfs deficiencies for t3600-rm.sh (git-rm)
Signed-off-by: Alex Riesen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 90924d5 commit d51fac5

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

t/t3600-rm.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ test_description='Test of the various options to git-rm.'
88
. ./test-lib.sh
99

1010
# Setup some files to be removed, some with funny characters
11-
touch -- foo bar baz 'space embedded' 'tab embedded' 'newline
12-
embedded' -q
13-
git-add -- foo bar baz 'space embedded' 'tab embedded' 'newline
14-
embedded' -q
15-
git-commit -m "add files"
11+
touch -- foo bar baz 'space embedded' -q
12+
git-add -- foo bar baz 'space embedded' -q
13+
git-commit -m "add normal files"
14+
test_tabs=y
15+
if touch -- 'tab embedded' 'newline
16+
embedded'
17+
then
18+
git-add -- 'tab embedded' 'newline
19+
embedded'
20+
git-commit -m "add files with tabs and newlines"
21+
else
22+
say 'Your filesystem does not allow tabs in filenames.'
23+
test_tabs=n
24+
fi
1625

1726
test_expect_success \
1827
'Pre-check that foo exists and is in index before git-rm foo' \
@@ -42,16 +51,18 @@ test_expect_success \
4251
'Test that "git-rm -- -q" succeeds (remove a file that looks like an option)' \
4352
'git-rm -- -q'
4453

45-
test_expect_success \
54+
test "$test_tabs" = y && test_expect_success \
4655
"Test that \"git-rm -f\" succeeds with embedded space, tab, or newline characters." \
4756
"git-rm -f 'space embedded' 'tab embedded' 'newline
4857
embedded'"
4958

59+
if test "$test_tabs" = y; then
5060
chmod u-w .
5161
test_expect_failure \
5262
'Test that "git-rm -f" fails if its rm fails' \
5363
'git-rm -f baz'
5464
chmod u+w .
65+
fi
5566

5667
test_expect_success \
5768
'When the rm in "git-rm -f" fails, it should not remove the file from the index' \

0 commit comments

Comments
 (0)