git-mergetool--lib.sh: use TOOL_MODE when erroring about unknown tool
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>
Philippe Blain committed
Nov 22, 2024 at 19:50 UTC
00536761df113c8ad935c78bf407e427fce2f040
1 file changed
+1
-1
git-mergetool--lib.sh
+1
-1
index 1ff26170ff..269a60ea44 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -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