mirror of
https://github.com/git/git.git
synced 2024-11-25 10:54:00 +08:00
7c10605d2c
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 <dunpealer@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 lines
309 B
Plaintext
19 lines
309 B
Plaintext
diff_cmd () {
|
|
"$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
|
|
}
|
|
|
|
merge_cmd () {
|
|
if $base_present
|
|
then
|
|
"$merge_tool_path" --merge --result="$MERGED" \
|
|
"$LOCAL" "$BASE" "$REMOTE"
|
|
else
|
|
"$merge_tool_path" --merge \
|
|
--result="$MERGED" "$LOCAL" "$REMOTE"
|
|
fi
|
|
}
|
|
|
|
exit_code_trustable () {
|
|
true
|
|
}
|