git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t/t5534: do not unset GIT_COMMITTER_EMAIL for other tests

From
Henning Schild <henning.schild@siemens.com>
Date
Jul 19, 2018, 12:14 UTC
Message-ID
<20180719121409.6143-1-henning.schild@siemens.com>
In-Reply-To
<xmqqbmb4lbhh.fsf@gitster-ct.c.googlers.com>

Unsetting the varibale for good can have unwanted effects for new tests added in the future It also meant we needed to hardcode the value for "user.signingkey". Move the unset into a subshell, get rid of the hardcoded "committer@example.com", and switch the GPG variant to using test_config just like GPGSM.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 t/t5534-push-signed.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index 0cb88aa6f..f6d674156 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -194,10 +194,12 @@ test_expect_success GPG 'fail without key and heed user.signingkey' '
 
 	EOF
 
-	unset GIT_COMMITTER_EMAIL &&
-	git config user.email hasnokey@nowhere.com &&
-	test_must_fail git push --signed dst noop ff +noff &&
-	git config user.signingkey committer@example.com &&
+	test_config user.email hasnokey@nowhere.com &&
+	(
+		unset GIT_COMMITTER_EMAIL &&
+		test_must_fail git push --signed dst noop ff +noff
+	) &&
+	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
 	git push --signed dst noop ff +noff &&
 
 	(
@@ -241,11 +243,14 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '
 	E_O_F
 
 	EOF
-	unset GIT_COMMITTER_EMAIL &&
+
 	test_config user.email hasnokey@nowhere.com &&
 	test_config user.signingkey "" &&
-	test_must_fail git push --signed dst noop ff +noff &&
-	test_config user.signingkey committer@example.com &&
+	(
+		unset GIT_COMMITTER_EMAIL &&
+		test_must_fail git push --signed dst noop ff +noff
+	) &&
+	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
 	git push --signed dst noop ff +noff &&
 
 	(
-- 
2.16.4
Previous: Junio C HamanoNext: Henning Schild
Message 16 of 24 in “X509 (gpgsm) commit signing support”
  1. 0/7 X509 (gpgsm) commit signing supportHenning Schild, Jul 17, 2018
  2. 2/7 t/t7510: check the validation of the new config gpg.formatHenning Schild, Jul 17, 2018
  3. Junio C HamanoJul 17, 2018
  4. Henning SchildJul 18, 2018
  5. 2/7 t/t7510: check the validation of the new config gpg.formatHenning Schild, Jul 18, 2018
  6. 4/7 gpg-interface: do not hardcode the key string len anymoreHenning Schild, Jul 17, 2018
  7. Junio C HamanoJul 17, 2018
  8. 3/7 gpg-interface: introduce an abstraction for multiple gpg formatsHenning Schild, Jul 17, 2018
  9. Junio C HamanoJul 17, 2018
  10. 5/7 gpg-interface: introduce new config to select per gpg format programHenning Schild, Jul 17, 2018
  11. 1/7 gpg-interface: add new config to select how to sign a commitHenning Schild, Jul 17, 2018
  12. 7/7 gpg-interface t: extend the existing GPG tests with GPGSMHenning Schild, Jul 17, 2018
  13. Junio C HamanoJul 17, 2018
  14. Henning SchildJul 18, 2018
  15. Junio C HamanoJul 18, 2018
  16. t/t5534: do not unset GIT_COMMITTER_EMAIL for other testsHenning Schild, Jul 19, 2018
  17. Henning SchildJul 19, 2018
  18. Junio C HamanoJul 19, 2018
  19. Henning SchildJul 20, 2018
  20. Taylor BlauJul 19, 2018
  21. 7/7 gpg-interface t: extend the existing GPG tests with GPGSMHenning Schild, Jul 18, 2018
  22. 7/7 gpg-interface t: extend the existing GPG tests with GPGSMHenning Schild, Jul 20, 2018
  23. Junio C HamanoJul 20, 2018
  24. 6/7 gpg-interface: introduce new signature format "x509" using gpgsmHenning Schild, Jul 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.