From de8dafbada811bc1bc8e1288541931f3c5406231 Mon Sep 17 00:00:00 2001 From: Seth House Date: Tue, 9 Feb 2021 13:07:11 -0700 Subject: mergetool: break setup_tool out into separate initialization function This is preparation for the following commit where we need to source the mergetool shell script to look for overrides before `run_merge_tool` is called. Previously `run_merge_tool` both sourced that script and invoked the mergetool. In the case of the following commit, we need the result of the `hide_resolved` override, if present, before we actually run `run_merge_tool`. The new `initialize_merge_tool` wrapper is exposed and documented as a public interface for consistency with the existing `run_merge_tool` which is also public. Although `setup_tool` could instead be exposed directly, the related `setup_user_tool` would probably also want to be elevated to match and this felt the cleanest to me. Signed-off-by: Seth House Signed-off-by: Junio C Hamano --- git-mergetool.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git-mergetool.sh') diff --git a/git-mergetool.sh b/git-mergetool.sh index 40a103443d..e5eac935f3 100755 --- a/git-mergetool.sh +++ b/git-mergetool.sh @@ -272,6 +272,8 @@ merge_file () { ext= esac + initialize_merge_tool "$merge_tool" || return + mergetool_tmpdir_init if test "$MERGETOOL_TMPDIR" != "." -- cgit v1.2.3