Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-reset <tree> -- <path> restores absense of <path> in <tree>
author
Junio C Hamano
<junkio@cox.net>
Fri, 5 Jan 2007 09:38:56 +0000
(
01:38
-0800)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 7 Jan 2007 06:57:42 +0000
(22:57 -0800)
When <path> exists in the index (either merged or unmerged), and
<tree> does not have it, git-reset should be usable to restore
the absense of it from the tree. This implements it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-reset.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
e9c8409
)
diff --git
a/git-reset.sh
b/git-reset.sh
index a9693701a34dac623fcddb1943ffe326bdb05405..76c8a818d421c796141fae3835e1cb4726d23ef3 100755
(executable)
--- a/
git-reset.sh
+++ b/
git-reset.sh
@@
-44,8
+44,10
@@
if test $# != 0
then
test "$reset_type" == "--mixed" ||
die "Cannot do partial $reset_type reset."
- git ls-tree -r --full-name $rev -- "$@" |
- git update-index --add --index-info || exit
+
+ git-diff-index --cached $rev -- "$@" |
+ sed -e 's/^:\([0-7][0-7]*\) [0-7][0-7]* \([0-9a-f][0-9a-f]*\) [0-9a-f][0-9a-f]* [A-Z] \(.*\)$/\1 \2 \3/' |
+ git update-index --add --remove --index-info || exit
git update-index --refresh
exit
fi