@@ -5,19 +5,16 @@ test_description=gitattributes
55. ./test-lib.sh
66
77attr_check () {
8- path=" $1 " expect=" $2 "
8+ path=" $1 " expect=" $2 " git_opts= " $3 " &&
99
10- git $3 check-attr test -- " $path " > actual 2> err &&
11- echo " $path : test: $2 " > expect &&
10+ git $git_opts check-attr test -- " $path " > actual 2> err &&
11+ echo " $path : test: $expect " > expect &&
1212 test_cmp expect actual &&
13- test_line_count = 0 err
13+ test_must_be_empty err
1414}
1515
1616attr_check_quote () {
17-
18- path=" $1 "
19- quoted_path=" $2 "
20- expect=" $3 "
17+ path=" $1 " quoted_path=" $2 " expect=" $3 " &&
2118
2219 git check-attr test -- " $path " > actual &&
2320 echo " \" $quoted_path \" : test: $expect " > expect &&
@@ -27,7 +24,7 @@ attr_check_quote () {
2724
2825test_expect_success ' open-quoted pathname' '
2926 echo "\"a test=a" >.gitattributes &&
30- test_must_fail attr_check a a
27+ attr_check a unspecified
3128'
3229
3330
@@ -112,20 +109,20 @@ test_expect_success 'attribute test' '
112109
113110test_expect_success ' attribute matching is case sensitive when core.ignorecase=0' '
114111
115- test_must_fail attr_check F f "-c core.ignorecase=0" &&
116- test_must_fail attr_check a/F f "-c core.ignorecase=0" &&
117- test_must_fail attr_check a/c/F f "-c core.ignorecase=0" &&
118- test_must_fail attr_check a/G a/g "-c core.ignorecase=0" &&
119- test_must_fail attr_check a/B/g a/b /g "-c core.ignorecase=0" &&
120- test_must_fail attr_check a/b/G a/b/g "-c core.ignorecase=0" &&
121- test_must_fail attr_check a/b/H a/b/h "-c core.ignorecase=0" &&
122- test_must_fail attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=0" &&
123- test_must_fail attr_check oNoFf unset "-c core.ignorecase=0" &&
124- test_must_fail attr_check oFfOn set "-c core.ignorecase=0" &&
112+ attr_check F unspecified "-c core.ignorecase=0" &&
113+ attr_check a/F unspecified "-c core.ignorecase=0" &&
114+ attr_check a/c/F unspecified "-c core.ignorecase=0" &&
115+ attr_check a/G unspecified "-c core.ignorecase=0" &&
116+ attr_check a/B/g a/g "-c core.ignorecase=0" &&
117+ attr_check a/b/G unspecified "-c core.ignorecase=0" &&
118+ attr_check a/b/H unspecified "-c core.ignorecase=0" &&
119+ attr_check a/b/D/g a/g "-c core.ignorecase=0" &&
120+ attr_check oNoFf unspecified "-c core.ignorecase=0" &&
121+ attr_check oFfOn unspecified "-c core.ignorecase=0" &&
125122 attr_check NO unspecified "-c core.ignorecase=0" &&
126- test_must_fail attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
123+ attr_check a/b/D/NO unspecified "-c core.ignorecase=0" &&
127124 attr_check a/b/d/YES a/b/d/* "-c core.ignorecase=0" &&
128- test_must_fail attr_check a/E/f "A/e/F" "-c core.ignorecase=0"
125+ attr_check a/E/f f "-c core.ignorecase=0"
129126
130127'
131128
@@ -149,8 +146,8 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase
149146'
150147
151148test_expect_success CASE_INSENSITIVE_FS ' additional case insensitivity tests' '
152- test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
153- test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
149+ attr_check a/B/D/g a/g "-c core.ignorecase=0" &&
150+ attr_check A/B/D/NO unspecified "-c core.ignorecase=0" &&
154151 attr_check A/b/h a/b/h "-c core.ignorecase=1" &&
155152 attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=1" &&
156153 attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=1"
244241 git check-attr foo -- "a/b/f" >>actual 2>>err &&
245242 git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
246243 test_cmp expect actual &&
247- test_line_count = 0 err
244+ test_must_be_empty err
248245'
249246
250247test_expect_success ' "**" with no slashes test' '
265262 git check-attr foo -- "a/b/f" >>actual 2>>err &&
266263 git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
267264 test_cmp expect actual &&
268- test_line_count = 0 err
265+ test_must_be_empty err
269266'
270267
271268test_expect_success ' using --git-dir and --work-tree' '
0 commit comments