summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 897643c)
raw | patch | inline | side by side (parent: 897643c)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 15 Nov 2006 18:54:10 +0000 (10:54 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 15 Nov 2006 20:01:44 +0000 (12:01 -0800) |
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>
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>
git-checkout.sh | patch | blob | history |
diff --git a/git-checkout.sh b/git-checkout.sh
index eb28b291b6d1b7d77306bb3437b9955671e45d3a..737abd0c094ae6cfb201fb46c28f4962a9826a02 100755 (executable)
--- a/git-checkout.sh
+++ b/git-checkout.sh
git-ls-tree --full-name -r "$new" "$@" |
git-update-index --index-info || exit $?
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 $?
else
# Make sure we did not fall back on $arg^{tree} codepath