git-apply: work from subdirectory.
[gitweb.git] / git-octopus.sh
index abc682025e5316e7d8612e5aa2057a700f618481..2edbf52c42d329bc1cd091f0ec07f6ccf032478e 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # Resolve two or more trees recorded in $GIT_DIR/FETCH_HEAD.
 #
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
 
 usage () {
     die "usage: git octopus"
@@ -86,5 +86,5 @@ esac
 result_commit=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD" |
                git-commit-tree $MRT $PARENT)
 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