mergetools/p4merge: create a base if none available
[git/git.git] / mergetools / p4merge
index 46b3a5a..5a608ab 100644 (file)
@@ -21,7 +21,11 @@ diff_cmd () {
 
 merge_cmd () {
        touch "$BACKUP"
-       $base_present || >"$BASE"
+       if ! $base_present
+       then
+               cp -- "$LOCAL" "$BASE"
+               create_virtual_base "$BASE" "$REMOTE"
+       fi
        "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
        check_unchanged
 }