3d204883a69355b95248b72e8c2078718fb07802

Author
Sukant Hajra <rrudbskr5g@snkmail.com>
Committer
Sukant Hajra <rrudbskr5g@snkmail.com>
Date

Message

fix gpg-agent "running already" check

The GPG_ENV file is sourced before doing the gpg-connect-agent check,
but this file (unlike the SSH_ENV file) doesn't export GPG_AGENT_INFO,
so the check always fails.  This results in new gpg-agents continuously
being spawned.

All this commit does is put in the single export to fix the problem.

Diff

 1diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh
 2index 4071334cb74fc18270a94a7bce4c88e9bf045357..b6992479d74cc45024a105566c36303902281b3d 100644
 3--- a/plugins/gpg-agent/gpg-agent.plugin.zsh
 4+++ b/plugins/gpg-agent/gpg-agent.plugin.zsh
 5@@ -19,6 +19,7 @@ if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
 6     # source settings of old agent, if applicable
 7     if [ -f "${GPG_ENV}" ]; then
 8         . ${GPG_ENV} > /dev/null
 9+        export GPG_AGENT_INFO
10     fi
11 
12     # check again if another agent is running using the newly sourced settings