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"
This commit is contained in:
11
git-merge.sh
11
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
|
||||
|
Reference in New Issue
Block a user