3 test_description
='setup taking and sanitizing funny paths'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
17 test_expect_success
'git add (absolute)' '
19 git add "$D/a/b/c/d" &&
20 git ls-files >current &&
21 echo a/b/c/d >expect &&
22 test_cmp expect current
27 test_expect_success
'git add (funny relative)' '
34 git ls-files >current &&
36 test_cmp expect current
40 test_expect_success
'git rm (absolute)' '
44 git rm -f --cached "$D/a/b/c/d" &&
45 git ls-files >current &&
47 test_cmp expect current
51 test_expect_success
'git rm (funny relative)' '
57 git rm -f --cached "../e/./f"
59 git ls-files >current &&
60 echo a/b/c/d >expect &&
61 test_cmp expect current
65 test_expect_success
'git ls-files (absolute)' '
69 git ls-files "$D/a/e/../b" >current &&
70 echo a/b/c/d >expect &&
71 test_cmp expect current
75 test_expect_success
'git ls-files (relative #1)' '
84 test_cmp expect current
88 test_expect_success
'git ls-files (relative #2)' '
94 git ls-files --full-name "../e/f"
97 test_cmp expect current
101 test_expect_success
'git ls-files (relative #3)' '
107 git ls-files "../e/f"
109 echo ../e/f >expect &&
110 test_cmp expect current
114 test_expect_success
'commit using absolute path names' '
115 git commit -m "foo" &&
117 git commit -m "aa" "$(pwd)/a/b/c/d"
120 test_expect_success
'log using absolute path names' '
122 git commit -m "bb" "$(pwd)/a/b/c/d" &&
124 git log a/b/c/d >f1.txt &&
125 git log "$(pwd)/a/b/c/d" >f2.txt &&
126 test_cmp f1.txt f2.txt
129 test_expect_success
'blame using absolute path names' '
130 git blame a/b/c/d >f1.txt &&
131 git blame "$(pwd)/a/b/c/d" >f2.txt &&
132 test_cmp f1.txt f2.txt
135 test_expect_success
'setup deeper work tree' '
136 test_create_repo tester
139 test_expect_success
'add a directory outside the work tree' '(
141 d1="$(cd .. && pwd)" &&
142 test_must_fail git add "$d1"
146 test_expect_success
'add a file outside the work tree, nasty case 1' '(
151 test_must_fail git add "$f"
154 test_expect_success
'add a file outside the work tree, nasty case 2' '(
156 f="$(pwd | sed "s/.$//")x" &&
159 test_must_fail git add "$f"