Skip to content

Commit

Permalink
t0012: verify that built-ins handle -h even without gitdir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Feb 7, 2022
1 parent 25d1a29 commit 49977ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion t/t0012-help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49977ff

Please sign in to comment.