diff options
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-x | git-merge.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/git-merge.sh b/git-merge.sh index 5890c7b1c0..29e86c6953 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -116,8 +116,9 @@ case "$#,$common" in # Again the most common case of merging one remote. echo "Updating from $head to $1." git-update-index --refresh 2>/dev/null - git-read-tree -u -m $head "$1" || exit 1 - git-rev-parse --verify "$1^0" > "$GIT_DIR/HEAD" + git-read-tree -u -m $head "$1" && + new_head=$(git-rev-parse --verify "$1^0") && + git-update-ref HEAD "$new_head" "$head" || exit 1 summary "$1" dropsave exit 0 @@ -215,9 +216,9 @@ then do parents="$parents -p $remote" done - result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) + result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit echo "Committed merge $result_commit, made by $wt_strategy." - echo $result_commit >"$GIT_DIR/HEAD" + git-update-ref HEAD $result_commit $head summary $result_commit dropsave exit 0 |