From: Junio C Hamano Date: Mon, 19 Nov 2007 00:04:17 +0000 (-0800) Subject: Merge branch 'ds/checkout-upper' X-Git-Tag: v1.5.4-rc0~183 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d577bc58a3424f4d0d7f7c8094753b92cb7cb823;p=git.git Merge branch 'ds/checkout-upper' * ds/checkout-upper: git-checkout: Test for relative path use. git-checkout: Support relative paths containing "..". --- d577bc58a3424f4d0d7f7c8094753b92cb7cb823 diff --cc git-checkout.sh index c00cedd48,616d1eb8f..aa724ac1a --- a/git-checkout.sh +++ b/git-checkout.sh @@@ -133,12 -134,12 +133,12 @@@ Did you intend to checkout '$@' which c 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