[PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.
This improves the workflow for, say, kernel subsystem backporting.
Signed-off-by: Michael K. Edwards <medwards-linux@gmail.com> --- git-checkout.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to git-checkout.sh +2 −1
diff --git a/git-checkout.sh b/git-checkout.sh index dd47724..5866604 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -106,7 +106,8 @@ Did you intend to checkout '$@' which ca git-ls-tree --full-name -r "$new" "$@" | git-update-index --index-info || exit $? fi - git-checkout-index -f -u -- "$@" + git-ls-files "$@" | + git-checkout-index -f -u --stdin exit $? else # Make sure we did not fall back on $arg^{tree} codepath