From: David Symonds Date: Fri, 9 Nov 2007 00:36:06 +0000 (+1100) Subject: git-checkout: Support relative paths containing "..". X-Git-Tag: v1.5.4-rc0~183^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4307234a4ea64ec56d017cfa737f986f4afcbf2a;p=git.git git-checkout: Support relative paths containing "..". Signed-off-by: David Symonds Signed-off-by: Junio C Hamano --- diff --git a/git-checkout.sh b/git-checkout.sh index 899392067..616d1eb8f 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