diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-11-18 16:04:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-18 16:04:17 -0800 |
commit | d577bc58a3424f4d0d7f7c8094753b92cb7cb823 (patch) | |
tree | 35902569e856a884a6bb2c31a26de5fdbc5713a0 /git-checkout.sh | |
parent | ffa06873d62bba358b51b43def2a0b3aefc790bf (diff) | |
parent | fed1b5cac0cc3ae324dc004181a276ea16589951 (diff) | |
download | git-d577bc58a3424f4d0d7f7c8094753b92cb7cb823.tar.gz |
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-x | git-checkout.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git-checkout.sh b/git-checkout.sh index c00cedd483..aa724ac1a3 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 |