X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-resolve.sh;h=1c7aaefa2528b73fea3eee22b086b94fa91854c5;hb=c301a0d2cf49b57f246ad73d0fd9f1cf203e7c16;hp=1f559d8cb91bf88e7ddc0abad55db7ad4550aeef;hpb=c1067050ce58b5b39f528fe634732da858664603;p=git.git
diff --git a/git-resolve.sh b/git-resolve.sh
index 1f559d8c..1c7aaefa 100755
--- a/git-resolve.sh
+++ b/git-resolve.sh
@@ -4,11 +4,9 @@
#
# Resolve two trees.
#
-. git-sh-setup || die "Not a git archive"
-usage () {
- die "git-resolve
"
-}
+USAGE=' '
+. git-sh-setup
dropheads() {
rm -f -- "$GIT_DIR/MERGE_HEAD" \
@@ -43,15 +41,18 @@ case "$common" in
exit 0
;;
"$head")
- echo "Updating from $head to $merge."
+ echo "Updating from $head to $merge"
git-read-tree -u -m $head $merge || exit 1
- echo $merge > "$GIT_DIR"/HEAD
+ git-update-ref HEAD "$merge" "$head"
git-diff-tree -p $head $merge | git-apply --stat
dropheads
exit 0
;;
esac
+# We are going to make a new commit.
+git var GIT_COMMITTER_IDENT >/dev/null || exit
+
# Find an optimum merge base if there are more than one candidates.
LF='
'
@@ -99,6 +100,6 @@ if [ $? -ne 0 ]; then
fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
-echo $result_commit > "$GIT_DIR"/HEAD
+git-update-ref HEAD "$result_commit" "$head"
git-diff-tree -p $head $result_commit | git-apply --stat
dropheads