summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-19 00:04:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-19 00:04:17 (GMT)
commitd577bc58a3424f4d0d7f7c8094753b92cb7cb823 (patch)
tree35902569e856a884a6bb2c31a26de5fdbc5713a0 /git-checkout.sh
parentffa06873d62bba358b51b43def2a0b3aefc790bf (diff)
parentfed1b5cac0cc3ae324dc004181a276ea16589951 (diff)
downloadgit-d577bc58a3424f4d0d7f7c8094753b92cb7cb823.zip
git-d577bc58a3424f4d0d7f7c8094753b92cb7cb823.tar.gz
git-d577bc58a3424f4d0d7f7c8094753b92cb7cb823.tar.bz2
Merge branch 'ds/checkout-upper'
* ds/checkout-upper: git-checkout: Test for relative path use. git-checkout: Support relative paths containing "..".
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 c00cedd..aa724ac 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -133,9 +133,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