]> git.ipfire.org Git - thirdparty/git.git/commit
lib-gpg: allow tests with GPGSM or GPGSSH prereq first
authorChristian Couder <christian.couder@gmail.com>
Mon, 13 Oct 2025 08:48:54 +0000 (10:48 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Oct 2025 15:51:41 +0000 (08:51 -0700)
commite204a167757d2c3e4914df60bad5cf78b0e6a9bb
treed181142e719701e3bf04d230382b7eaa19ee19fe
parentdb674095c025870249c5e283ee9cacefad6a8fa9
lib-gpg: allow tests with GPGSM or GPGSSH prereq first

When the 'GPG' prereq is lazily tested, `mkdir "$GNUPGHOME"` could
fail if the "$GNUPGHOME" directory already exists. This can happen if
the 'GPGSM' or the 'GPGSSH' prereq has been lazily tested before as they
already create "$GNUPGHOME".

To allow the GPGSM or the GPGSSH prereq to appear before the GPG prereq
in some test scripts, let's refactor the creation and setup of the
"$GNUPGHOME"` directory in a new prepare_gnupghome() function that uses
`mkdir -p "$GNUPGHOME"`.

This will be useful in a following commit.

Unfortunately the new prepare_gnupghome() function cannot be used when
lazily testing the GPG2 prereq, because that would expose existing,
hidden bugs in "t1016-compatObjectFormat.sh", so let's just document
that with a NEEDSWORK comment.

Helped-by: Todd Zullinger <tmz@pobox.com>
Helped-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-gpg.sh