Skip to content

Commit 0216af8

Browse files
mhaggergitster
authored andcommitted
git-check-attr: Demonstrate problems with relative paths
Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d4d4f8d commit 0216af8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

t/t0003-attributes.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ attr_check () {
1919

2020
test_expect_success 'setup' '
2121
22-
mkdir -p a/b/d a/c &&
22+
mkdir -p a/b/d a/c b &&
2323
(
2424
echo "[attr]notest !test"
2525
echo "f test=f"
@@ -102,6 +102,19 @@ test_expect_failure 'unnormalized paths' '
102102
103103
'
104104

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+
105118
test_expect_success 'core.attributesfile' '
106119
attr_check global unspecified &&
107120
git config core.attributesfile "$HOME/global-gitattributes" &&

0 commit comments

Comments
 (0)