summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-01 14:30:30 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-01 14:30:52 -0700
commita64d7784e830b3140e7d0f2b45cb3d8fafb84cca (patch)
tree9e10928ef209844c8961fcf7116ff88cd414929c /git-merge.sh
parent0f49327c9755b6575b447f79b540749d231cb26d (diff)
downloadgit-a64d7784e830b3140e7d0f2b45cb3d8fafb84cca.tar.gz
git-merge: no reason to use cpio anymore
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>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 3a01db0d75..976117ac90 100755
--- 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" \
- "$GIT_DIR/MERGE_SAVE" || exit 1
+ "$GIT_DIR/MERGE_STASH" || exit 1
}
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() {
- if test -f "$GIT_DIR/MERGE_SAVE"
+ if test -f "$GIT_DIR/MERGE_STASH"
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
}
@@ -386,7 +385,7 @@ case "$use_strategies" in
single_strategy=no
;;
*)
- rm -f "$GIT_DIR/MERGE_SAVE"
+ rm -f "$GIT_DIR/MERGE_STASH"
single_strategy=yes
;;
esac