X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-checkout.sh;h=616d1eb8f8647d69bca0decc181aff2657bfae73;hb=fed1b5cac0cc3ae324dc004181a276ea16589951;hp=89939206732849e968fabaf9128597c87f18f5c7;hpb=e75c55844fd0ff96d00173574b1e49cc472ca928;p=git.git 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