From 7c10605d2ccf499af6136e993cf248892be39168 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 29 Nov 2016 01:38:07 -0800 Subject: mergetool: honor mergetool.$tool.trustExitCode for built-in tools Built-in merge tools contain a hard-coded assumption about whether or not a tool's exit code can be trusted to determine the success or failure of a merge. Tools whose exit codes are not trusted contain calls to check_unchanged() in their merge_cmd() functions. A problem with this is that the trustExitCode configuration is not honored for built-in tools. Teach built-in tools to honor the trustExitCode configuration. Extend run_merge_cmd() so that it is responsible for calling check_unchanged() when a tool's exit code cannot be trusted. Remove check_unchanged() calls from scriptlets since they are no longer responsible for calling it. When no configuration is present, exit_code_trustable() is checked to see whether the exit code should be trusted. The default implementation returns false. Tools whose exit codes can be trusted override exit_code_trustable() to true. Reported-by: Dun Peal Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- mergetools/p4merge | 2 -- 1 file changed, 2 deletions(-) (limited to 'mergetools/p4merge') diff --git a/mergetools/p4merge b/mergetools/p4merge index 5a608abf9c..7a5b291dd2 100644 --- a/mergetools/p4merge +++ b/mergetools/p4merge @@ -20,14 +20,12 @@ diff_cmd () { } merge_cmd () { - touch "$BACKUP" if ! $base_present then cp -- "$LOCAL" "$BASE" create_virtual_base "$BASE" "$REMOTE" fi "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED" - check_unchanged } create_empty_file () { -- cgit v1.2.3