guess_merge_tool calls translate_merge_tool_path in order to get the
correct name of the tool to check whether it can be found on the user's
system.  But this function is designed to be overridden by tool
scriptlets so it does nothing if the relevant scriptlet has not been
sourced.

Fix this by calling setup_tool before doing anything.

Signed-off-by: John Keeping <j...@keeping.me.uk>
---
 git-mergetool--lib.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index c6bd8ba..46860c5 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -219,6 +219,7 @@ guess_merge_tool () {
        # Loop over each candidate and stop when a valid merge tool is found.
        for i in $tools
        do
+               setup_tool "$i" 2>&1 || continue
                merge_tool_path="$(translate_merge_tool_path "$i")"
                if type "$merge_tool_path" >/dev/null 2>&1
                then
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to