3 test_description
='test case exclude pathspec'
7 test_expect_success
'setup' '
8 for p in file sub/file sub/sub/file sub/file2 sub/sub/sub/file sub2/file; do
9 if echo $p | grep /; then
16 git log --oneline --format=%s >actual &&
25 test_cmp expect actual
28 test_expect_success
'exclude only should error out' '
29 test_must_fail git log --oneline --format=%s -- ":(exclude)sub"
32 test_expect_success
't_e_i() exclude sub' '
33 git log --oneline --format=%s -- . ":(exclude)sub" >actual
38 test_cmp expect actual
41 test_expect_success
't_e_i() exclude sub/sub/file' '
42 git log --oneline --format=%s -- . ":(exclude)sub/sub/file" >actual
50 test_cmp expect actual
53 test_expect_success
't_e_i() exclude sub using mnemonic' '
54 git log --oneline --format=%s -- . ":!sub" >actual
59 test_cmp expect actual
62 test_expect_success
't_e_i() exclude :(icase)SUB' '
63 git log --oneline --format=%s -- . ":(exclude,icase)SUB" >actual
68 test_cmp expect actual
71 test_expect_success
't_e_i() exclude sub2 from sub' '
74 git log --oneline --format=%s -- :/ ":/!sub2" >actual
82 test_cmp expect actual
86 test_expect_success
't_e_i() exclude sub/*file' '
87 git log --oneline --format=%s -- . ":(exclude)sub/*file" >actual
93 test_cmp expect actual
96 test_expect_success
't_e_i() exclude :(glob)sub/*/file' '
97 git log --oneline --format=%s -- . ":(exclude,glob)sub/*/file" >actual
105 test_cmp expect actual
108 test_expect_success
'm_p_d() exclude sub' '
109 git ls-files -- . ":(exclude)sub" >actual
114 test_cmp expect actual
117 test_expect_success
'm_p_d() exclude sub/sub/file' '
118 git ls-files -- . ":(exclude)sub/sub/file" >actual
126 test_cmp expect actual
129 test_expect_success
'm_p_d() exclude sub using mnemonic' '
130 git ls-files -- . ":!sub" >actual
135 test_cmp expect actual
138 test_expect_success
'm_p_d() exclude :(icase)SUB' '
139 git ls-files -- . ":(exclude,icase)SUB" >actual
144 test_cmp expect actual
147 test_expect_success
'm_p_d() exclude sub2 from sub' '
150 git ls-files -- :/ ":/!sub2" >actual
158 test_cmp expect actual
162 test_expect_success
'm_p_d() exclude sub/*file' '
163 git ls-files -- . ":(exclude)sub/*file" >actual
169 test_cmp expect actual
172 test_expect_success
'm_p_d() exclude :(glob)sub/*/file' '
173 git ls-files -- . ":(exclude,glob)sub/*/file" >actual
181 test_cmp expect actual