cherry-pick: handle root commits with external strategies
[gitweb.git] / git-mergetool--lib.sh
index eeefb9c29946fc748e6278d571e7c07e67e144bc..4db9212331259664732f031438b7b87b7a10244f 100644 (file)
@@ -187,7 +187,7 @@ run_merge_tool () {
                        fi
                        check_unchanged
                else
-                       "$merge_tool_path" -f -d -c "wincmd l" \
+                       "$merge_tool_path" -R -f -d -c "wincmd l" \
                                "$LOCAL" "$REMOTE"
                fi
                ;;
@@ -198,7 +198,7 @@ run_merge_tool () {
                                "$LOCAL" "$MERGED" "$REMOTE"
                        check_unchanged
                else
-                       "$merge_tool_path" -f -d -c "wincmd l" \
+                       "$merge_tool_path" -R -f -d -c "wincmd l" \
                                "$LOCAL" "$REMOTE"
                fi
                ;;
@@ -258,12 +258,9 @@ run_merge_tool () {
                ;;
        p4merge)
                if merge_mode; then
-                   touch "$BACKUP"
-                       if $base_present; then
-                               "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
-                       else
-                               "$merge_tool_path" "$LOCAL" "$LOCAL" "$REMOTE" "$MERGED"
-                       fi
+                       touch "$BACKUP"
+                       $base_present || >"$BASE"
+                       "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
                        check_unchanged
                else
                        "$merge_tool_path" "$LOCAL" "$REMOTE"