summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-02-08 11:21:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-08 17:54:44 (GMT)
commit87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5 (patch)
treece6f4ec9a2d5454f1ec7fcf06914573601483862 /t
parent059fda190215d18e7aa23f825cd607b16a016b65 (diff)
downloadgit-87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5.zip
git-87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5.tar.gz
git-87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5.tar.bz2
t0012: verify that built-ins handle `-h` even without gitdir
We just fixed a class of recently introduced bugs where calling, say, `git fetch -h` outside a repository would not show the usage but instead show an ugly `BUG` message. Let's verify that this does not regress anymore. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t0012-help.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 91b68c7..cbd725c 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -139,13 +139,18 @@ test_expect_success 'git help --config-sections-for-completion' '
'
test_expect_success 'generate builtin list' '
+ mkdir -p sub &&
git --list-cmds=builtins >builtins
'
while read builtin
do
test_expect_success "$builtin can handle -h" '
- test_expect_code 129 git $builtin -h >output 2>&1 &&
+ (
+ GIT_CEILING_DIRECTORIES=$(pwd) &&
+ export GIT_CEILING_DIRECTORIES &&
+ test_expect_code 129 git -C sub $builtin -h >output 2>&1
+ ) &&
test_i18ngrep usage output
'
done <builtins