Skip to content

Commit 87ad07d

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 059fda1 commit 87ad07d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/t0012-help.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,18 @@ test_expect_success 'git help --config-sections-for-completion' '
139139
'
140140

141141
test_expect_success 'generate builtin list' '
142+
mkdir -p sub &&
142143
git --list-cmds=builtins >builtins
143144
'
144145

145146
while read builtin
146147
do
147148
test_expect_success "$builtin can handle -h" '
148-
test_expect_code 129 git $builtin -h >output 2>&1 &&
149+
(
150+
GIT_CEILING_DIRECTORIES=$(pwd) &&
151+
export GIT_CEILING_DIRECTORIES &&
152+
test_expect_code 129 git -C sub $builtin -h >output 2>&1
153+
) &&
149154
test_i18ngrep usage output
150155
'
151156
done <builtins

0 commit comments

Comments
 (0)