summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-25 07:12:06 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-27 01:04:17 (GMT)
commitdeca7e8c591608c9ffd0bf0aaf10b379da9f6d6e (patch)
tree49b93d4d45cd52f4c05b1030d05b4b8329c5824a /git-merge.sh
parente2f5f6ef6795c880a2f13ea472b96704b4a4ca94 (diff)
downloadgit-deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e.zip
git-deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e.tar.gz
git-deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e.tar.bz2
Give default merge message after failed automerge.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 413bfca..7607e81 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -19,7 +19,7 @@ default_strategies='resolve octopus'
use_strategies=
dropsave() {
- rm -f -- "$GIT_DIR/MERGE_HEAD" \
+ rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
"$GIT_DIR/MERGE_SAVE" || exit 1
}
@@ -28,9 +28,12 @@ savestate() {
}
restorestate() {
- git reset --hard $head
- cpio -iuv <"$GIT_DIR/MERGE_SAVE"
- git-update-index --refresh >/dev/null
+ if test -f "$GIT_DIR/MERGE_SAVE"
+ then
+ git reset --hard $head
+ cpio -iuv <"$GIT_DIR/MERGE_SAVE"
+ git-update-index --refresh >/dev/null
+ fi
}
summary() {
@@ -160,6 +163,7 @@ case "$use_strategies" in
single_strategy=no
;;
*)
+ rm -f "$GIT_DIR/MERGE_SAVE"
single_strategy=yes
;;
esac
@@ -242,4 +246,6 @@ for remote
do
echo $remote
done >"$GIT_DIR/MERGE_HEAD"
+echo $merge_msg >"$GIT_DIR/MERGE_MSG"
+
die "Automatic merge failed; fix up by hand"