]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-mergetool--lib.sh: use TOOL_MODE when erroring about unknown tool
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Fri, 22 Nov 2024 19:50:19 +0000 (19:50 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Nov 2024 02:59:19 +0000 (11:59 +0900)
In git-mergetool--lib.sh::get_merge_tool_path, we check if the chosen
tool is valid via valid_tool and exit with an error message if not. This
error message mentions "Unknown merge tool", even if the command the
user tried was 'git difftool --tool=unknown'. Use the global 'TOOL_MODE'
variable for a more correct error message.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-mergetool--lib.sh

index 1ff26170ffcff8e3ebe768ecc946b1c7deb53949..269a60ea44c4a6dd83c123a94a1d6617059fbd01 100644 (file)
@@ -474,7 +474,7 @@ get_merge_tool_path () {
        merge_tool="$1"
        if ! valid_tool "$merge_tool"
        then
-               echo >&2 "Unknown merge tool $merge_tool"
+               echo >&2 "Unknown $TOOL_MODE tool $merge_tool"
                exit 1
        fi
        if diff_mode