Add new git-rm command with documentation
[git.git] / t / t3600-rm.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2006 Carl D. Worth
4 #
5
6 test_description='Test of the various options to git-rm.'
7
8 . ./test-lib.sh
9
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"
17
18 test_expect_success \
19     'Pre-check that foo is in index before git-rm foo' \
20     'git-ls-files --error-unmatch foo'
21
22 test_expect_success \
23     'Test that git-rm foo succeeds' \
24     'git-rm foo'
25
26 test_expect_failure \
27     'Post-check that foo is not in index after git-rm foo' \
28     'git-ls-files --error-unmatch foo'
29
30 test_expect_success \
31     'Test that "git-rm -f bar" works' \
32     'git-rm -f bar'
33
34 test_expect_failure \
35     'Post-check that bar no longer exists' \
36     '[ -f bar ]'
37
38 test_expect_success \
39     'Test that "git-rm -- -q" works to delete a file named -q' \
40     'git-rm -- -q'
41
42 test_done