author | Junio C Hamano <gitster@pobox.com> | |
Mon, 19 Nov 2007 00:04:17 +0000 (16:04 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 19 Nov 2007 00:04:17 +0000 (16:04 -0800) |
* ds/checkout-upper:
git-checkout: Test for relative path use.
git-checkout: Support relative paths containing "..".
git-checkout: Test for relative path use.
git-checkout: Support relative paths containing "..".
1 | 2 | |||
---|---|---|---|---|
git-checkout.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc git-checkout.sh
index c00cedd4837577647e369bd398fb3f6635674544,616d1eb8f8647d69bca0decc181aff2657bfae73..aa724ac1a3859791187d257da6445d2b4adc1de8
--- 1/git-checkout.sh
--- 2/git-checkout.sh
+++ b/git-checkout.sh
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
+ # Run a post-checkout hook -- the HEAD does not change so the
+ # current HEAD is passed in for both args
if test -x "$GIT_DIR"/hooks/post-checkout; then
"$GIT_DIR"/hooks/post-checkout $old $old 0
fi