git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t7800-difftool.sh: Test mergetool.prompt fallback

From
David Aguilar <davvid@gmail.com>
Date
Jan 23, 2010, 05:58 UTC
Message-ID
<1264226280-18888-1-git-send-email-davvid@gmail.com>

4cacc621 made difftool fall back to mergetool.prompt when difftool.prompt is unconfigured. This adds a test.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 t/t7800-difftool.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index fad5472..a16bfa0 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -27,6 +27,7 @@ remove_config_vars()
 	git config --unset difftool.prompt
 	git config --unset merge.tool
 	git config --unset mergetool.test-tool.cmd
+	git config --unset mergetool.prompt
 	return 0
 }
 
@@ -159,6 +160,17 @@ test_expect_success 'difftool.prompt config variable is false' '
 	restore_test_defaults
 '
 
+# Test that we don't have to pass --no-prompt when mergetool.prompt is false
+test_expect_success 'difftool merge.promptconfig = false' '
+	git config --unset difftool.prompt
+	git config mergetool.prompt false &&
+
+	diff=$(git difftool branch) &&
+	test "$diff" = "branch" &&
+
+	restore_test_defaults
+'
+
 # Test that the -y flag can override difftool.prompt = true
 test_expect_success 'difftool.prompt can overridden with -y' '
 	git config difftool.prompt true &&
-- 
1.6.6.1.436.gaba7d.dirty
Message 1 of 1 in “t7800-difftool.sh: Test mergetool.prompt fallback”
  1. t7800-difftool.sh: Test mergetool.prompt fallbackDavid Aguilar, Jan 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.