Code

git-reset to remove "$GIT_DIR/MERGE_MSG" v1.4.4.2
authorJunio C Hamano <junkio@cox.net>
Tue, 5 Dec 2006 03:44:40 +0000 (19:44 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 6 Dec 2006 18:47:14 +0000 (10:47 -0800)
An earlier commit a9cb3c6e changed git-commit to use the
contents of MERGE_MSG even when we do not have MERGE_HEAD (the
rationale is in its log message).

However, the change tricks the following sequence to include a
merge message in a completely unrelated commit:

$ git pull somewhere
: oops, the conflicts are too much.  forget it.
        $ git reset --hard
        : work work work
        $ git commit

To fix this confusion, this patch makes "git reset" to remove
the leftover MERGE_MSG that was prepared when the user abandoned
the merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Luben Tuikov <ltuikov@yahoo.com
git-reset.sh

index 3133b5bd25ca7ad3c2a5451ee9c2e0f4514cd980..c0feb4435d15da9cc9928800cbe270018f044152 100755 (executable)
@@ -63,6 +63,7 @@ case "$reset_type" in
        ;;
 esac
 
-rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" "$GIT_DIR/SQUASH_MSG"
+rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" \
+       "$GIT_DIR/SQUASH_MSG" "$GIT_DIR/MERGE_MSG"
 
 exit $update_ref_status