Introduce core.sharedrepository
[gitweb.git] / git-resolve.sh
index 1f559d8cb91bf88e7ddc0abad55db7ad4550aeef..926307005493b7c8c4253b1adff34bdb4bc57b77 100755 (executable)
@@ -4,11 +4,9 @@
 #
 # Resolve two trees.
 #
-. git-sh-setup || die "Not a git archive"
 
-usage () {
-       die "git-resolve <head> <remote> <merge-message>"
-}
+USAGE='<head> <remote> <merge-message>'
+. git-sh-setup
 
 dropheads() {
        rm -f -- "$GIT_DIR/MERGE_HEAD" \
@@ -45,7 +43,7 @@ case "$common" in
 "$head")
        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
@@ -99,6 +97,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