]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2202-add-addremove.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t2202-add-addremove.sh
CommitLineData
340ce9e2
JH
1#!/bin/sh
2
3test_description='git add --all'
4
5. ./test-lib.sh
6
7test_expect_success setup '
8 (
2c2d0f9f 9 echo .gitignore &&
340ce9e2
JH
10 echo will-remove
11 ) >expect &&
12 (
2c2d0f9f
ES
13 echo actual &&
14 echo expect &&
340ce9e2
JH
15 echo ignored
16 ) >.gitignore &&
29abb339 17 git --literal-pathspecs add --all &&
340ce9e2
JH
18 >will-remove &&
19 git add --all &&
20 test_tick &&
21 git commit -m initial &&
22 git ls-files >actual &&
23 test_cmp expect actual
24'
25
26test_expect_success 'git add --all' '
27 (
2c2d0f9f
ES
28 echo .gitignore &&
29 echo not-ignored &&
30 echo "M .gitignore" &&
31 echo "A not-ignored" &&
340ce9e2
JH
32 echo "D will-remove"
33 ) >expect &&
34 >ignored &&
35 >not-ignored &&
36 echo modification >>.gitignore &&
37 rm -f will-remove &&
38 git add --all &&
39 git update-index --refresh &&
40 git ls-files >actual &&
41 git diff-index --name-status --cached HEAD >>actual &&
42 test_cmp expect actual
43'
44
76b62358
JH
45test_expect_success 'Just "git add" is a no-op' '
46 git reset --hard &&
47 echo >will-remove &&
48 >will-not-be-added &&
49 git add &&
50 git diff-index --name-status --cached HEAD >actual &&
d3c6751b 51 test_must_be_empty actual
76b62358
JH
52'
53
340ce9e2 54test_done