merge-recursive: convert struct stage_data to use object_id
[gitweb.git] / git-rebase--merge.sh
index d3fb67d75bd3cdfebd048594cdb67eb179b1c435..8d43db9069f5c478fa6cb2deb6cf7d1d37f1e6b2 100644 (file)
@@ -67,7 +67,9 @@ call_merge () {
                GIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY
        fi
        test -z "$strategy" && strategy=recursive
-       eval 'git-merge-$strategy' $strategy_opts '"$cmt^" -- "$hd" "$cmt"'
+       # If cmt doesn't have a parent, don't include it as a base
+       base=$(git rev-parse --verify --quiet $cmt^)
+       eval 'git-merge-$strategy' $strategy_opts $base ' -- "$hd" "$cmt"'
        rv=$?
        case "$rv" in
        0)
@@ -94,10 +96,8 @@ finish_rb_merge () {
        if test -s "$state_dir"/rewritten
        then
                git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
-               if test -x "$GIT_DIR"/hooks/post-rewrite
-               then
-                       "$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
-               fi
+               hook="$(git rev-parse --git-path hooks/post-rewrite)"
+               test -x "$hook" && "$hook" rebase <"$state_dir"/rewritten
        fi
        say All done.
 }