'
-# This is not expected to work as ls-files was not designed
-# to deal with such. Enable it when ls-files is updated.
-: test_expect_success 'checkout with complex relative path' '
-
- rm file1 &&
- git checkout HEAD -- ../dir1/../dir1/file1 && test -f ./file1
-
+test_expect_success 'checkout with complex relative path' '
+ (
+ cd dir1 &&
+ rm file1 &&
+ git checkout HEAD -- ../dir1/../dir1/file1 &&
+ test "hello" = "$(cat file1)"
+ )
'
test_expect_success 'relative path outside tree should fail' \
- '! git checkout HEAD -- ../../Makefile'
+ 'test_must_fail git checkout HEAD -- ../../Makefile'
test_expect_success 'incorrect relative path to file should fail (1)' \
- '! git checkout HEAD -- ../file0'
+ 'test_must_fail git checkout HEAD -- ../file0'
test_expect_success 'incorrect relative path should fail (2)' \
- '( cd dir1 && ! git checkout HEAD -- ./file0 )'
+ '( cd dir1 && test_must_fail git checkout HEAD -- ./file0 )'
test_expect_success 'incorrect relative path should fail (3)' \
- '( cd dir1 && ! git checkout HEAD -- ../../file0 )'
+ '( cd dir1 && test_must_fail git checkout HEAD -- ../../file0 )'
test_done