git-checkout: allow pathspec to recover lost working tree directory
It is often wanted on the #git channel that this were to work to recover removed directory: rm -fr Documentation git checkout -- Documentation git checkout HEAD -- Documentation ;# alternatively Now it does. Signed-off-by: Junio C Hamano <junkio@cox.net>maint
parent
897643cc79
commit
bf7e1472df
|
@ -112,7 +112,11 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
|
||||||
git-ls-tree --full-name -r "$new" "$@" |
|
git-ls-tree --full-name -r "$new" "$@" |
|
||||||
git-update-index --index-info || exit $?
|
git-update-index --index-info || exit $?
|
||||||
fi
|
fi
|
||||||
git-checkout-index -f -u -- "$@"
|
|
||||||
|
# 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
|
||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
# Make sure we did not fall back on $arg^{tree} codepath
|
# Make sure we did not fall back on $arg^{tree} codepath
|
||||||
|
|
Loading…
Reference in New Issue