Skip to content

Commit

Permalink
t7800-difftool.sh: Test mergetool.prompt fallback
Browse files Browse the repository at this point in the history
4cacc62 made difftool fall back to mergetool.prompt
when difftool.prompt is unconfigured.  This adds a test.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Jan 23, 2010
1 parent aba7dea commit a88183f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t7800-difftool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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.prompt = 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 &&
Expand Down

0 comments on commit a88183f

Please sign in to comment.