diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index e7fa4f5d43ffb95e79a295b3969ea1ad0160a82e..1c77192eb318d007689089eaf42f4f939c2f9ee4 100755 (executable)
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
git check-attr test -- "$path" >actual &&
echo "$path: test: $2" >expect &&
git check-attr test -- "$path" >actual &&
echo "$path: test: $2" >expect &&
- diff -u expect actual
+ test_cmp expect actual
}
}
'
'
+test_expect_success 'attribute test: read paths from stdin' '
+
+ cat <<EOF > expect
+f: test: f
+a/f: test: f
+a/c/f: test: f
+a/g: test: a/g
+a/b/g: test: a/b/g
+b/g: test: unspecified
+a/b/h: test: a/b/h
+a/b/d/g: test: a/b/d/*
+EOF
+
+ sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'root subdir attribute test' '
attr_check a/i a/i &&
test_expect_success 'root subdir attribute test' '
attr_check a/i a/i &&
'
'
+test_expect_success 'setup bare' '
+
+ git clone --bare . bare.git &&
+ cd bare.git
+
+'
+
+test_expect_success 'bare repository: check that .gitattribute is ignored' '
+
+ (
+ echo "f test=f"
+ echo "a/i test=a/i"
+ ) >.gitattributes &&
+ attr_check f unspecified &&
+ attr_check a/f unspecified &&
+ attr_check a/c/f unspecified &&
+ attr_check a/i unspecified &&
+ attr_check subdir/a/i unspecified
+
+'
+
+test_expect_success 'bare repository: test info/attributes' '
+
+ (
+ echo "f test=f"
+ echo "a/i test=a/i"
+ ) >info/attributes &&
+ attr_check f f &&
+ attr_check a/f f &&
+ attr_check a/c/f f &&
+ attr_check a/i a/i &&
+ attr_check subdir/a/i unspecified
+
+'
+
test_done
test_done