Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Torres <santiago@nyu.edu>2017-07-21 00:05:52 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-21 01:46:20 +0300
commit29ff1f8f7493ecd5b90521adff6ed523d61ec73f (patch)
treea7a5d562819e5d7feb170fefbc64077adcff8955 /t/lib-gpg.sh
parent08f9c32463bf9e578acb7ac5f77afd36e803c6bc (diff)
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>
Diffstat (limited to 't/lib-gpg.sh')
-rwxr-xr-xt/lib-gpg.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index ec2aa8f687..43679a4c64 100755
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -31,6 +31,7 @@ then
chmod 0700 ./gpghome &&
GNUPGHOME="$(pwd)/gpghome" &&
export GNUPGHOME &&
+ (gpgconf --kill gpg-agent 2>&1 >/dev/null || : ) &&
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \