aboutsummaryrefslogtreecommitdiff
path: root/t/t3600-rm.sh
blob: 841573210a83e0f6c33ef135e7fc86b45af14802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# Copyright (c) 2006 Carl D. Worth
#

test_description='Test of the various options to git-rm.'

. ./test-lib.sh

# Setup some files to be removed
touch foo bar
git-add foo bar
# Need one to test --
touch -- -q
git update-index --add -- -q
git-commit -m "add foo, bar, and -q"

test_expect_success \
    'Pre-check that foo is in index before git-rm foo' \
    'git-ls-files --error-unmatch foo'

test_expect_success \
    'Test that git-rm foo succeeds' \
    'git-rm foo'

test_expect_failure \
    'Post-check that foo is not in index after git-rm foo' \
    'git-ls-files --error-unmatch foo'

test_expect_success \
    'Test that "git-rm -f bar" works' \
    'git-rm -f bar'

test_expect_failure \
    'Post-check that bar no longer exists' \
    '[ -f bar ]'

test_expect_success \
    'Test that "git-rm -- -q" works to delete a file named -q' \
    'git-rm -- -q'

test_done