841573210a83e0f6c33ef135e7fc86b45af14802
1 #!/bin/sh
2 #
3 # Copyright (c) 2006 Carl D. Worth
4 #
6 test_description='Test of the various options to git-rm.'
8 . ./test-lib.sh
10 # Setup some files to be removed
11 touch foo bar
12 git-add foo bar
13 # Need one to test --
14 touch -- -q
15 git update-index --add -- -q
16 git-commit -m "add foo, bar, and -q"
18 test_expect_success \
19 'Pre-check that foo is in index before git-rm foo' \
20 'git-ls-files --error-unmatch foo'
22 test_expect_success \
23 'Test that git-rm foo succeeds' \
24 'git-rm foo'
26 test_expect_failure \
27 'Post-check that foo is not in index after git-rm foo' \
28 'git-ls-files --error-unmatch foo'
30 test_expect_success \
31 'Test that "git-rm -f bar" works' \
32 'git-rm -f bar'
34 test_expect_failure \
35 'Post-check that bar no longer exists' \
36 '[ -f bar ]'
38 test_expect_success \
39 'Test that "git-rm -- -q" works to delete a file named -q' \
40 'git-rm -- -q'
42 test_done