Give default merge message after failed automerge.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Sep 25, 2005 at 00:12 UTC
deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e
2 files changed
+13
-4
git-commit.sh
+3
@@ -141,6 +141,9 @@ t)
141
esac
142
143
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
144
+
145
+ test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG"
146
+
147
echo "#"
148
echo "# It looks like your may be committing a MERGE."
149
echo "# If this is not correct, please remove the file"
git-merge.sh
+10
-4
@@ -19,7 +19,7 @@ default_strategies='resolve octopus'
19
use_strategies=
20
21
dropsave() {
22
- rm -f -- "$GIT_DIR/MERGE_HEAD" \
22
+ rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
23
"$GIT_DIR/MERGE_SAVE" || exit 1
24
}
25
@@ -28,9 +28,12 @@ savestate() {
28
}
29
30
restorestate() {
31
- git reset --hard $head
32
- cpio -iuv <"$GIT_DIR/MERGE_SAVE"
33
- git-update-index --refresh >/dev/null
31
+ if test -f "$GIT_DIR/MERGE_SAVE"
32
+ then
33
+ git reset --hard $head
34
+ cpio -iuv <"$GIT_DIR/MERGE_SAVE"
35
+ git-update-index --refresh >/dev/null
36
+ fi
37
}
38
39
summary() {
@@ -160,6 +163,7 @@ case "$use_strategies" in
163
single_strategy=no
164
;;
165
*)
166
+ rm -f "$GIT_DIR/MERGE_SAVE"
167
single_strategy=yes
168
;;
169
esac
@@ -242,4 +246,6 @@ for remote
246
do
247
echo $remote
248
done >"$GIT_DIR/MERGE_HEAD"
249
+echo $merge_msg >"$GIT_DIR/MERGE_MSG"
250
+
251
die "Automatic merge failed; fix up by hand"