Give default merge message after failed automerge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2005-09-25 00:12:06 -07:00
parent e2f5f6ef67
commit deca7e8c59
2 changed files with 13 additions and 4 deletions

View File

@ -141,6 +141,9 @@ t)
esac esac
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG"
echo "#" echo "#"
echo "# It looks like your may be committing a MERGE." echo "# It looks like your may be committing a MERGE."
echo "# If this is not correct, please remove the file" echo "# If this is not correct, please remove the file"

View File

@ -19,7 +19,7 @@ default_strategies='resolve octopus'
use_strategies= use_strategies=
dropsave() { dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" \ rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
"$GIT_DIR/MERGE_SAVE" || exit 1 "$GIT_DIR/MERGE_SAVE" || exit 1
} }
@ -28,9 +28,12 @@ savestate() {
} }
restorestate() { restorestate() {
git reset --hard $head if test -f "$GIT_DIR/MERGE_SAVE"
cpio -iuv <"$GIT_DIR/MERGE_SAVE" then
git-update-index --refresh >/dev/null git reset --hard $head
cpio -iuv <"$GIT_DIR/MERGE_SAVE"
git-update-index --refresh >/dev/null
fi
} }
summary() { summary() {
@ -160,6 +163,7 @@ case "$use_strategies" in
single_strategy=no single_strategy=no
;; ;;
*) *)
rm -f "$GIT_DIR/MERGE_SAVE"
single_strategy=yes single_strategy=yes
;; ;;
esac esac
@ -242,4 +246,6 @@ for remote
do do
echo $remote echo $remote
done >"$GIT_DIR/MERGE_HEAD" done >"$GIT_DIR/MERGE_HEAD"
echo $merge_msg >"$GIT_DIR/MERGE_MSG"
die "Automatic merge failed; fix up by hand" die "Automatic merge failed; fix up by hand"