Skip to content

Commit

Permalink
Give default merge message after failed automerge.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 27, 2005
1 parent e2f5f6e commit deca7e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ t)
esac

if [ -f "$GIT_DIR/MERGE_HEAD" ]; then

test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG"

echo "#"
echo "# It looks like your may be committing a MERGE."
echo "# If this is not correct, please remove the file"
Expand Down
14 changes: 10 additions & 4 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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() {
Expand Down Expand Up @@ -160,6 +163,7 @@ case "$use_strategies" in
single_strategy=no
;;
*)
rm -f "$GIT_DIR/MERGE_SAVE"
single_strategy=yes
;;
esac
Expand Down Expand Up @@ -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"

0 comments on commit deca7e8

Please sign in to comment.