Skip to content

Commit

Permalink
Clean up MERGE_HEAD and ORIG_HEAD also for the trivial fast-forward m…
Browse files Browse the repository at this point in the history
…erges.

Otherwise you'll be bitten by a stale MERGE_HEAD like Jeff was..
  • Loading branch information
Linus Torvalds committed Jun 20, 2005
1 parent 31b6d20 commit 55a716c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-resolve-script
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ 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
echo "Updating from $head to $merge."
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"
Expand All @@ -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"

0 comments on commit 55a716c

Please sign in to comment.