summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 02:42:21 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 02:42:21 (GMT)
commit55a716cc8c93fd2eb161ae17f316ee01e8061be6 (patch)
treecf4134d676441b019a7bc3c3899c268c77cbce79
parent31b6d200d6c5ed019f62d88ef0926faeb0150aac (diff)
downloadgit-55a716cc8c93fd2eb161ae17f316ee01e8061be6.zip
git-55a716cc8c93fd2eb161ae17f316ee01e8061be6.tar.gz
git-55a716cc8c93fd2eb161ae17f316ee01e8061be6.tar.bz2
Clean up MERGE_HEAD and ORIG_HEAD also for the trivial fast-forward merges.
Otherwise you'll be bitten by a stale MERGE_HEAD like Jeff was..
-rwxr-xr-xgit-resolve-script4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-resolve-script b/git-resolve-script
index 0b04a5f..007e29a 100755
--- a/git-resolve-script
+++ b/git-resolve-script
@@ -32,6 +32,7 @@ fi
if [ "$common" == "$merge" ]; then
echo "Already up-to-date. Yeeah!"
+ rm -f -- "$GIT_DIR/ORIG_HEAD" "$GIT_DIR/MERGE_HEAD"
exit 0
fi
if [ "$common" == "$head" ]; then
@@ -39,6 +40,7 @@ if [ "$common" == "$head" ]; then
git-read-tree -u -m $head $merge || exit 1
echo $merge > "$GIT_DIR"/HEAD
git-diff-tree -p ORIG_HEAD HEAD | git-apply --stat
+ rm -f -- "$GIT_DIR/ORIG_HEAD" "$GIT_DIR/MERGE_HEAD"
exit 0
fi
echo "Trying to merge $merge into $head"
@@ -58,4 +60,4 @@ result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $me
echo "Committed merge $result_commit"
echo $result_commit > "$GIT_DIR"/HEAD
git-diff-tree -p $head $result_commit | git-apply --stat
-rm $GIT_DIR/ORIG_HEAD $GIT_DIR/MERGE_HEAD
+rm -f -- "$GIT_DIR/ORIG_HEAD" "$GIT_DIR/MERGE_HEAD"