[PATCH 2/2] t0012: verify that built-ins handle `-h` even without gitdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Schindelin <johannes.schindelin@xxxxxx>

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@xxxxxx>
---
 t/t0012-help.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 91b68c74a15..cbd725ccac8 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
-- 
gitgitgadget



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux