3 # Copyright (c) 2006 Carl D. Worth
6 test_description='Test of the various options to git-rm.'
10 # Setup some files to be removed, some with funny characters
11 touch -- foo bar baz 'space embedded' 'tab embedded' 'newline
13 git-add -- foo bar baz 'space embedded' 'tab embedded' 'newline
15 git-commit -m "add files"
18 'Pre-check that foo exists and is in index before git-rm foo' \
19 '[ -f foo ] && git-ls-files --error-unmatch foo'
22 'Test that git-rm foo succeeds' \
26 'Post-check that foo exists but is not in index after git-rm foo' \
27 '[ -f foo ] && ! git-ls-files --error-unmatch foo'
30 'Pre-check that bar exists and is in index before "git-rm -f bar"' \
31 '[ -f bar ] && git-ls-files --error-unmatch bar'
34 'Test that "git-rm -f bar" succeeds' \
38 'Post-check that bar does not exist and is not in index after "git-rm -f bar"' \
39 '! [ -f bar ] && ! git-ls-files --error-unmatch bar'
42 'Test that "git-rm -- -q" succeeds (remove a file that looks like an option)' \
46 "Test that \"git-rm -f\" succeeds with embedded space, tab, or newline characters." \
47 "git-rm -f 'space embedded' 'tab embedded' 'newline
52 'Test that "git-rm -f" fails if its rm fails' \
57 'When the rm in "git-rm -f" fails, it should not remove the file from the index' \
58 'git-ls-files --error-unmatch baz'