This test was put in, but commented out in fed1b5ca (2007-11-09,
git-checkout: Test for relative path use.)
It's been a while since 2007 and the intended test case works now.
(I could not find the enabling commit in ls-files however.)
The code in question however did not change into the sub directory,
so we still need to add a 'cd'. Also a test for the file content has been
added. This is already part of the other tests for checkout.
Signed-off-by: Stefan Beller <stefanbel...@googlemail.com>
t/t2008-checkout-subdir.sh | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh
index 3e098ab..399655f 100755
@@ -58,13 +58,14 @@ test_expect_success 'checkout with simple prefix' '
-# 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 -f file1 &&
+ test "hello" = "$(cat file1)"
test_expect_success 'relative path outside tree should fail' \
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html