summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-02-10 12:52:25 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-10 12:52:25 -0800
commit163d24dc4d914191d1981ed0d9fa2a5d91b7d412 (patch)
tree99efdce4c601aeca8dbeea4779a39e651c3b46fd /t
parentMerge branch 'rs/p5302-create-repositories-before-tests' (diff)
parentt7800: simplify basic usage test (diff)
downloadtgif-163d24dc4d914191d1981ed0d9fa2a5d91b7d412.tar.xz
Merge branch 'js/difftool-builtin'
A few hot-fixes to C-rewrite of "git difftool". * js/difftool-builtin: t7800: simplify basic usage test difftool: fix bug when printing usage
Diffstat (limited to 't')
-rwxr-xr-xt/t7800-difftool.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index aa0ef02597..97bae54d83 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -23,6 +23,18 @@ prompt_given ()
test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
}
+test_expect_success 'basic usage requires no repo' '
+ test_expect_code 129 git difftool -h >output &&
+ grep ^usage: output &&
+ # create a ceiling directory to prevent Git from finding a repo
+ mkdir -p not/repo &&
+ test_when_finished rm -r not &&
+ test_expect_code 129 \
+ env GIT_CEILING_DIRECTORIES="$(pwd)/not" \
+ git -C not/repo difftool -h >output &&
+ grep ^usage: output
+'
+
# Create a file on master and change it on branch
test_expect_success 'setup' '
echo master >file &&