summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorDavid Symonds <dsymonds@gmail.com>2007-11-09 00:36:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-12 01:00:07 (GMT)
commit4307234a4ea64ec56d017cfa737f986f4afcbf2a (patch)
tree2ea89359460963c93e23cfb7dce0cd09aa138b6e /git-checkout.sh
parent40e2524da9f9fb2806a66a694b9aee722ea3ef0a (diff)
downloadgit-4307234a4ea64ec56d017cfa737f986f4afcbf2a.zip
git-4307234a4ea64ec56d017cfa737f986f4afcbf2a.tar.gz
git-4307234a4ea64ec56d017cfa737f986f4afcbf2a.tar.bz2
git-checkout: Support relative paths containing "..".
Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index 8993920..616d1eb 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -134,9 +134,9 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
fi
# Make sure the request is about existing paths.
- git ls-files --error-unmatch -- "$@" >/dev/null || exit
- git ls-files -- "$@" |
- git checkout-index -f -u --stdin
+ git ls-files --full-name --error-unmatch -- "$@" >/dev/null || exit
+ git ls-files --full-name -- "$@" |
+ (cd_to_toplevel && git checkout-index -f -u --stdin)
# Run a post-checkout hook -- the HEAD does not change so the
# current HEAD is passed in for both args