summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 81a2de2b9d..1c81f46cbf 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -23,6 +23,19 @@ prompt_given ()
test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
}
+test_expect_success 'basic usage requires no repo' '
+ lines=$(git difftool -h | grep ^usage: | wc -l) &&
+ test "$lines" -eq 1 &&
+ # create a ceiling directory to prevent Git from finding a repo
+ mkdir -p not/repo &&
+ ceiling="$PWD/not" &&
+ lines=$(cd not/repo &&
+ GIT_CEILING_DIRECTORIES="$ceiling" git difftool -h |
+ grep ^usage: | wc -l) &&
+ test "$lines" -eq 1 &&
+ rmdir -p not/repo
+'
+
# Create a file on master and change it on branch
test_expect_success 'setup' '
echo master >file &&