From 1a715ccbac66160106e80c66be54d9be652c5bfb Mon Sep 17 00:00:00 2001 From: Michael Schindler Date: Mon, 7 Jun 2021 21:50:07 +0200 Subject: [PATCH] use get_merge_tool_path() also in is_available() to honor settings fix the is_available test used in git mergetool --tool-help or git difftool --tool-help or to check the list of tools available when no tool is configured/given with --tool symtoms: the actual tool running run_merge_tool () considers the difftool. "$merge_tool".path and mergetool."$merge_tool".path and if configured honors these. See get_merge_tool_path () in git-mergetool--lib.sh If not set use fallback: translate_merge_tool_path "$merge_tool". The is_available () just uses translate_merge_tool_path "$merge_tool". repo 1: Configure an invalid path in mergetool."$merge_tool".path for a tool of your choice. You will be informed that the tool is available, but when trying to use it will not be found because the invalid configured path is used. repo2: Install a tool of your choice on a nonstandard place (e.g. rename the program) and configure mergetool."$merge_tool".path for this tool. You will be informed that the tool is not available (because not found on standard place), but when trying to run it will work. This fix will make the information consistent by using get_merge_tool_path() also in is_available() Signed-off-by: Michael Schindler --- git-mergetool--lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 542a6a75eb3c4b..8b946e585d7fc0 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -18,7 +18,7 @@ mode_ok () { } is_available () { - merge_tool_path=$(translate_merge_tool_path "$1") && + merge_tool_path=$(get_merge_tool_path "$1") && type "$merge_tool_path" >/dev/null 2>&1 }