git-check-attr: Demonstrate problems with relative paths

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Aug 4, 2011 at 06:47 UTC 0216af8356ef562147251c40fef72be25b8b9b07
1 file changed +14 -1
t/t0003-attributes.sh
+14 -1
@@ -19,7 +19,7 @@ attr_check () {
19
20 test_expect_success 'setup' '
21
22 - mkdir -p a/b/d a/c &&
22 + mkdir -p a/b/d a/c b &&
23 (
24 echo "[attr]notest !test"
25 echo "f test=f"
@@ -102,6 +102,19 @@ test_expect_failure 'unnormalized paths' '
102
103 '
104
105 +test_expect_failure 'relative paths' '
106 +
107 + (cd a && attr_check ../f f) &&
108 + (cd a && attr_check f f) &&
109 + (cd a && attr_check i a/i) &&
110 + (cd a && attr_check g a/g) &&
111 + (cd a && attr_check b/g a/b/g) &&
112 + (cd b && attr_check ../a/f f) &&
113 + (cd b && attr_check ../a/g a/g) &&
114 + (cd b && attr_check ../a/b/g a/b/g)
115 +
116 +'
117 +
118 test_expect_success 'core.attributesfile' '
119 attr_check global unspecified &&
120 git config core.attributesfile "$HOME/global-gitattributes" &&