aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-20 15:54:54 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-20 16:07:20 -0800
commit6010d2d957fb05838cd3ab887ac261752ff8ff87 (patch)
tree049bfc4f7ff92b6113686ac429b76e66dc9dcad4 /t
parentb0030db331141bedfaf02f34a83f18712c0ae011 (diff)
downloadgit-6010d2d957fb05838cd3ab887ac261752ff8ff87.tar.gz
git-6010d2d957fb05838cd3ab887ac261752ff8ff87.tar.xz
checkout: work from a subdirectory
When switching branches from a subdirectory, checkout rewritten in C extracted the toplevel of the tree in there. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7201-co.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 5492f21c7..0fa94678a 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -263,4 +263,38 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
'
+test_expect_success 'switch branches while in subdirectory' '
+
+ git reset --hard &&
+ git checkout master &&
+
+ mkdir subs &&
+ (
+ cd subs &&
+ git checkout side
+ ) &&
+ ! test -f subs/one &&
+ rm -fr subs
+
+'
+
+test_expect_success 'checkout specific path while in subdirectory' '
+
+ git reset --hard &&
+ git checkout side &&
+ mkdir subs &&
+ >subs/bero &&
+ git add subs/bero &&
+ git commit -m "add subs/bero" &&
+
+ git checkout master &&
+ mkdir -p subs &&
+ (
+ cd subs &&
+ git checkout side -- bero
+ ) &&
+ test -f subs/bero
+
+'
+
test_done