summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-14 22:05:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-14 22:05:47 (GMT)
commit5e389c430d232e8b1a16e7357596328985111eab (patch)
treecec4f0c0e6281c537798c61be9127d0ee0ac9175 /git-merge.sh
parent55571f7861b81b033b378f3abe145ecbdbc1fdb6 (diff)
parenta9ee9bf9f9840498f2369ebafe6c220deb4327fd (diff)
downloadgit-5e389c430d232e8b1a16e7357596328985111eab.zip
git-5e389c430d232e8b1a16e7357596328985111eab.tar.gz
git-5e389c430d232e8b1a16e7357596328985111eab.tar.bz2
Merge branch 'jc/stash-create'
* jc/stash-create: git-stash: Fix listing stashes git-merge: no reason to use cpio anymore Revert "rebase: allow starting from a dirty tree." rebase: allow starting from a dirty tree. stash: implement "stash create"
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 c2092a2..b9f0519 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
}
@@ -437,7 +436,7 @@ case "$use_strategies" in
single_strategy=no
;;
*)
- rm -f "$GIT_DIR/MERGE_SAVE"
+ rm -f "$GIT_DIR/MERGE_STASH"
single_strategy=yes
;;
esac