3 test_description
=gitattributes
12 git check-attr
test -- "$path" >actual
&&
13 echo "$path: test: $2" >expect
&&
14 test_cmp expect actual
19 test_expect_success
'setup' '
29 ) >a/.gitattributes &&
31 echo "h test=a/b/h" &&
32 echo "d/* test=a/b/d/*"
37 test_expect_success
'attribute test' '
43 attr_check a/b/g a/b/g &&
44 attr_check b/g unspecified &&
45 attr_check a/b/h a/b/h &&
46 attr_check a/b/d/g "a/b/d/*"
50 test_expect_success
'attribute test: read paths from stdin' '
58 b/g: test: unspecified
60 a/b/d/g: test: a/b/d/*
63 sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
64 test_cmp expect actual
67 test_expect_success
'root subdir attribute test' '
70 attr_check subdir/a/i unspecified
74 test_expect_success
'setup bare' '
76 git clone --bare . bare.git &&
81 test_expect_success
'bare repository: check that .gitattribute is ignored' '
87 attr_check f unspecified &&
88 attr_check a/f unspecified &&
89 attr_check a/c/f unspecified &&
90 attr_check a/i unspecified &&
91 attr_check subdir/a/i unspecified
95 test_expect_success
'bare repository: test info/attributes' '
100 ) >info/attributes &&
103 attr_check a/c/f f &&
104 attr_check a/i a/i &&
105 attr_check subdir/a/i unspecified