diff options
Diffstat (limited to 'mergetools')
-rw-r--r-- | mergetools/defaults | 28 | ||||
-rw-r--r-- | mergetools/p4merge | 25 |
2 files changed, 27 insertions, 26 deletions
diff --git a/mergetools/defaults b/mergetools/defaults index 1d8f2a3dd3..21e63ecc3e 100644 --- a/mergetools/defaults +++ b/mergetools/defaults @@ -8,36 +8,12 @@ can_diff () { } diff_cmd () { - merge_tool_cmd="$(get_merge_tool_cmd "$1")" - if test -z "$merge_tool_cmd" - then - status=1 - break - fi - ( eval $merge_tool_cmd ) - status=$? + status=1 return $status } merge_cmd () { - merge_tool_cmd="$(get_merge_tool_cmd "$1")" - if test -z "$merge_tool_cmd" - then - status=1 - break - fi - trust_exit_code="$(git config --bool \ - mergetool."$1".trustExitCode || echo false)" - if test "$trust_exit_code" = "false" - then - touch "$BACKUP" - ( eval $merge_tool_cmd ) - status=$? - check_unchanged - else - ( eval $merge_tool_cmd ) - status=$? - fi + status=1 return $status } diff --git a/mergetools/p4merge b/mergetools/p4merge index 1a45c1b0c5..295361a8aa 100644 --- a/mergetools/p4merge +++ b/mergetools/p4merge @@ -1,5 +1,30 @@ diff_cmd () { + # p4merge does not like /dev/null + rm_local= + rm_remote= + if test "/dev/null" = "$LOCAL" + then + LOCAL="./p4merge-dev-null.LOCAL.$$" + >"$LOCAL" + rm_local=true + fi + if test "/dev/null" = "$REMOTE" + then + REMOTE="./p4merge-dev-null.REMOTE.$$" + >"$REMOTE" + rm_remote=true + fi + "$merge_tool_path" "$LOCAL" "$REMOTE" + + if test -n "$rm_local" + then + rm -f "$LOCAL" + fi + if test -n "$rm_remote" + then + rm -f "$REMOTE" + fi } merge_cmd () { |