mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
t: lib-gpg: flush gpg agent on startup
When running gpg-relevant tests, a gpg-daemon is spawned for each GNUPGHOME used. This daemon may stay running after the test and cache file descriptors for the trash directories, even after the trash directory is removed. This leads to ENOENT errors when attempting to create files if tests are run multiple times. Add a cleanup script to force flushing the gpg-agent for that GNUPGHOME (if any) before setting up the GPG relevant-environment. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Santiago Torres <santiago@nyu.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
08f9c32463
commit
29ff1f8f74
|
@ -31,6 +31,7 @@ then
|
||||||
chmod 0700 ./gpghome &&
|
chmod 0700 ./gpghome &&
|
||||||
GNUPGHOME="$(pwd)/gpghome" &&
|
GNUPGHOME="$(pwd)/gpghome" &&
|
||||||
export GNUPGHOME &&
|
export GNUPGHOME &&
|
||||||
|
(gpgconf --kill gpg-agent 2>&1 >/dev/null || : ) &&
|
||||||
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
|
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
|
||||||
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
|
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
|
||||||
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
|
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
|
||||||
|
|
Loading…
Reference in a new issue