summaryrefslogtreecommitdiff
path: root/t/lib-gpg.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-12 20:33:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-12 21:54:05 (GMT)
commit4b0bf39dd580239f647cb925a57566bf60c1f93c (patch)
tree4bde6c8f8d66db4eab3f6f4883ea65b771732c67 /t/lib-gpg.sh
parent1e3eefbc8d942f94d59d745bbfe91d28d39e680d (diff)
downloadgit-4b0bf39dd580239f647cb925a57566bf60c1f93c.zip
git-4b0bf39dd580239f647cb925a57566bf60c1f93c.tar.gz
git-4b0bf39dd580239f647cb925a57566bf60c1f93c.tar.bz2
tests: squelch noise from GPG machinery set-up
It is distracting to let the GPG message while setting up the test gpghome leak into the test output, especially without running these tests with "-v" option. The splitting of RFC1991 prerequiste part is about future-proofing. When we want to define other kinds of specific prerequisites in the future, we'd prefer to see it done separately from the basic set-up code. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-gpg.sh')
-rwxr-xr-xt/lib-gpg.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index b611b78..33de402 100755
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -16,23 +16,25 @@ else
# Type DSA and Elgamal, size 2048 bits, no expiration date.
# Name and email: C O Mitter <committer@example.com>
# No password given, to enable non-interactive operation.
- mkdir ./gpghome
- chmod 0700 ./gpghome
- GNUPGHOME="$(pwd)/gpghome"
- export GNUPGHOME
- gpg --homedir "${GNUPGHOME}" --import \
- "$TEST_DIRECTORY"/lib-gpg/keyring.gpg
- gpg --homedir "${GNUPGHOME}" --import-ownertrust \
- "$TEST_DIRECTORY"/lib-gpg/ownertrust
+ mkdir ./gpghome &&
+ chmod 0700 ./gpghome &&
+ GNUPGHOME="$(pwd)/gpghome" &&
+ export GNUPGHOME &&
+ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
+ "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
+ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
+ "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
test_set_prereq GPG
- if echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
- then
- test_set_prereq RFC1991
- fi
;;
esac
fi
+if test_have_prereq GPG &&
+ echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
+then
+ test_set_prereq RFC1991
+fi
+
sanitize_pgp() {
perl -ne '
/^-----END PGP/ and $in_pgp = 0;