summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-18 21:53:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-18 21:53:30 (GMT)
commitc5973cb98ff4fe0779e90e04de7c099cc2256a3a (patch)
treed09aedb1405c3b20e31b81c982edf697e4036fbc /t
parent9b7e531f94c610439cff3c8d4556742524184463 (diff)
parent87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5 (diff)
downloadgit-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.zip
git-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.tar.gz
git-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.tar.bz2
Merge branch 'js/short-help-outside-repo-fix'
"git cmd -h" outside a repository should error out cleanly for many commands, but instead it hit a BUG(), which has been corrected. * js/short-help-outside-repo-fix: t0012: verify that built-ins handle `-h` even without gitdir checkout/fetch/pull/pack-objects: allow `-h` outside a repository
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