@matheusbsbs / matheus-bagliano / commits / 4307234a4e
Fork 0

git-checkout: Support relative paths containing "..".

Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Symonds committed Nov 9, 2007 at 11:36 UTC 4307234a4ea64ec56d017cfa737f986f4afcbf2a
1 file changed +3 -3
git-checkout.sh
+3 -3
@@ -134,9 +134,9 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
134 fi
135
136 # Make sure the request is about existing paths.
137 - git ls-files --error-unmatch -- "$@" >/dev/null || exit
138 - git ls-files -- "$@" |
139 - git checkout-index -f -u --stdin
137 + git ls-files --full-name --error-unmatch -- "$@" >/dev/null || exit
138 + git ls-files --full-name -- "$@" |
139 + (cd_to_toplevel && git checkout-index -f -u --stdin)
140
141 # Run a post-checkout hook -- the HEAD does not change so the
142 # current HEAD is passed in for both args