[PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

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(-)

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
-- 
1.4.3.5
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Make "git checkout <branch> <path>" work..., Michael K. Edwards, (Fri Nov 17, 1:49 am)
Re: [PATCH] Make "git checkout &lt;branch&gt; &lt;path&gt;" ..., Michael K. Edwards, (Fri Nov 17, 2:18 am)