summaryrefslogtreecommitdiff
path: root/t/t2008-checkout-subdir.sh
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2013-10-09 14:35:11 (GMT)
committerJonathan Nieder <jrnieder@gmail.com>2013-10-09 19:49:55 (GMT)
commitb0afc02649285febd6155c1c64d2383b856c1c0e (patch)
treec9e32f5bd33d0667159c1b3ed74896e9512136da /t/t2008-checkout-subdir.sh
parent1e155359bf58d7063f75bdb218987aedf62ad550 (diff)
downloadgit-b0afc02649285febd6155c1c64d2383b856c1c0e.zip
git-b0afc02649285febd6155c1c64d2383b856c1c0e.tar.gz
git-b0afc02649285febd6155c1c64d2383b856c1c0e.tar.bz2
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>
Diffstat (limited to 't/t2008-checkout-subdir.sh')
-rwxr-xr-xt/t2008-checkout-subdir.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh
index 3e098ab..eadb943 100755
--- a/t/t2008-checkout-subdir.sh
+++ b/t/t2008-checkout-subdir.sh
@@ -58,13 +58,13 @@ 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 "hello" = "$(cat file1)"
+ )
'
test_expect_success 'relative path outside tree should fail' \