File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,20 @@ test_description='Test of the various options to git-rm.'
8
8
. ./test-lib.sh
9
9
10
10
# 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
16
25
17
26
test_expect_success \
18
27
' Pre-check that foo exists and is in index before git-rm foo' \
@@ -42,16 +51,18 @@ test_expect_success \
42
51
' Test that "git-rm -- -q" succeeds (remove a file that looks like an option)' \
43
52
' git-rm -- -q'
44
53
45
- test_expect_success \
54
+ test " $test_tabs " = y && test_expect_success \
46
55
" Test that \" git-rm -f\" succeeds with embedded space, tab, or newline characters." \
47
56
" git-rm -f 'space embedded' 'tab embedded' 'newline
48
57
embedded'"
49
58
59
+ if test " $test_tabs " = y; then
50
60
chmod u-w .
51
61
test_expect_failure \
52
62
' Test that "git-rm -f" fails if its rm fails' \
53
63
' git-rm -f baz'
54
64
chmod u+w .
65
+ fi
55
66
56
67
test_expect_success \
57
68
' When the rm in "git-rm -f" fails, it should not remove the file from the index' \
You can’t perform that action at this time.
0 commit comments