mergetool: avoid misleading message "Resetting to default..."
authorSteffen Prohaska <prohaska@zib.de>
Thu, 18 Oct 2007 10:25:34 +0000 (12:25 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 18 Oct 2007 23:59:58 +0000 (19:59 -0400)
If no mergetool is configured in the configuration variable
merge.tool the resetting message should not be printed.

This is fixed. The message is only printed if a tool is configured
but the entry in merge.tool is invalid.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-mergetool.sh
index 94511f9d1ace4e41bd225cd25643b17770b075b1..a68b40386bde1c47c33a19514ec3a22db7fb0e4b 100755 (executable)
@@ -334,7 +334,7 @@ init_merge_tool_path() {
 
 if test -z "$merge_tool"; then
     merge_tool=`git config merge.tool`
-    if ! valid_tool "$merge_tool"; then
+    if test -n "$merge_tool" && ! valid_tool "$merge_tool"; then
            echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
            echo >&2 "Resetting to default..."
            unset merge_tool