Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-merge: no reason to use cpio anymore
author
Junio C Hamano
<gitster@pobox.com>
Thu, 1 Nov 2007 21:30:30 +0000
(14:30 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 1 Nov 2007 21:30:52 +0000
(14:30 -0700)
Now we have "git stash create", we can use it to safely stash
away the dirty state in the tree.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-merge.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0f49327
)
diff --git
a/git-merge.sh
b/git-merge.sh
index 3a01db0d751e272541efd0f27177a9ca5cb63bbe..976117ac9006fcc3bc33b2f6079bd3caad8ed639 100755
(executable)
--- a/
git-merge.sh
+++ b/
git-merge.sh
@@
-28,20
+28,19
@@
allow_trivial_merge=t
dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
- "$GIT_DIR/MERGE_S
AVE
" || exit 1
+ "$GIT_DIR/MERGE_S
TASH
" || exit 1
}
savestate() {
# Stash away any local modifications.
}
savestate() {
# Stash away any local modifications.
- git diff-index -z --name-only $head |
- cpio -0 -o >"$GIT_DIR/MERGE_SAVE"
+ git stash create >"$GIT_DIR/MERGE_STASH"
}
restorestate() {
}
restorestate() {
- if test -f "$GIT_DIR/MERGE_S
AVE
"
+ if test -f "$GIT_DIR/MERGE_S
TASH
"
then
git reset --hard $head >/dev/null
then
git reset --hard $head >/dev/null
- cpio -iuv <"$GIT_DIR/MERGE_SAVE"
+ git stash apply $(cat "$GIT_DIR/MERGE_STASH")
git update-index --refresh >/dev/null
fi
}
git update-index --refresh >/dev/null
fi
}
@@
-386,7
+385,7
@@
case "$use_strategies" in
single_strategy=no
;;
*)
single_strategy=no
;;
*)
- rm -f "$GIT_DIR/MERGE_S
AVE
"
+ rm -f "$GIT_DIR/MERGE_S
TASH
"
single_strategy=yes
;;
esac
single_strategy=yes
;;
esac