summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t7800-difftool.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 1c81f46cbf..3d728e296d 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -24,16 +24,15 @@ prompt_given ()
}
test_expect_success 'basic usage requires no repo' '
- lines=$(git difftool -h | grep ^usage: | wc -l) &&
- test "$lines" -eq 1 &&
+ 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 &&
- 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
+ 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