Merge commit 'junio/next' into next
[git/platforms/storm.git] / t / t0003-attributes.sh
blobc56d2fbabaa0fdd90547ce8b629a629c21fbbc0e
1 #!/bin/sh
3 test_description=gitattributes
5 . ./test-lib.sh
7 attr_check () {
9 path="$1"
10 expect="$2"
12 git check-attr test -- "$path" >actual &&
13 echo "$path: test: $2" >expect &&
14 test_cmp expect actual
19 test_expect_success 'setup' '
21 mkdir -p a/b/d a/c &&
23 echo "f test=f"
24 echo "a/i test=a/i"
25 ) >.gitattributes &&
27 echo "g test=a/g" &&
28 echo "b/g test=a/b/g"
29 ) >a/.gitattributes &&
31 echo "h test=a/b/h" &&
32 echo "d/* test=a/b/d/*"
33 ) >a/b/.gitattributes
37 test_expect_success 'attribute test' '
39 attr_check f f &&
40 attr_check a/f f &&
41 attr_check a/c/f f &&
42 attr_check a/g a/g &&
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 'root subdir attribute test' '
52 attr_check a/i a/i &&
53 attr_check subdir/a/i unspecified
57 test_done