checkout test: enable test with complex relative path
This test was added, commented out, in fed1b5ca (git-checkout: Test for relative path use, 2007-11-09). Later git's path handling was improved (d089ebaa, setup: sanitize absolute and funny paths in get_pathspec(), 2008-01-28) but we forgot to enable the now-working test. This test expects to run from a subdirectory, so add a 'cd'. While we're here, examine the content of the checked-out file instead of just checking that it exists. The other checkout tests already do the same. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Stefan Beller committed
Oct 9, 2013 at 16:35 UTC
b0afc02649285febd6155c1c64d2383b856c1c0e
1 file changed
+7
-7
t/t2008-checkout-subdir.sh
+7
-7
@@ -58,13 +58,13 @@ test_expect_success 'checkout with simple prefix' '
58
59
'
60
61
-# This is not expected to work as ls-files was not designed
62
-# to deal with such. Enable it when ls-files is updated.
63
-: test_expect_success 'checkout with complex relative path' '
64
-
65
- rm file1 &&
66
- git checkout HEAD -- ../dir1/../dir1/file1 && test -f ./file1
67
-
61
+test_expect_success 'checkout with complex relative path' '
62
+ (
63
+ cd dir1 &&
64
+ rm file1 &&
65
+ git checkout HEAD -- ../dir1/../dir1/file1 &&
66
+ test "hello" = "$(cat file1)"
67
+ )
68
'
69
70
test_expect_success 'relative path outside tree should fail' \