aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-remote-gcrypt
diff options
context:
space:
mode:
authorchrysn <chrysn@fsfe.org>2015-11-10 13:52:49 +0100
committerchrysn <chrysn@fsfe.org>2015-12-21 17:09:14 +0100
commitb43e192e5132bbfe297dcd8b58c49ed78aaae899 (patch)
treeb2691f4645ebb4d5cbdd6155b02f4a657890b4a3 /git-remote-gcrypt
parent5dcc77f507d497fe4023e94a47b6a7a1f1146bce (diff)
downloadgit-remote-gcrypt-b43e192e5132bbfe297dcd8b58c49ed78aaae899.tar.gz
Use git's the gpg.program if configured
Keyrings managed with gpg2 can contain secret keys whose public part is unavailable to classic gpg; on the other hand, gpg2 won't see keys created in gpg after an initial import. Situations in which error messages like "gpg: error reading key: public key not found" pop up can now be circumvented by setting the gpg.program git configuration entry to gpg2.
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-xgit-remote-gcrypt5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 8d68669..3d8a39b 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -30,6 +30,7 @@ Manifestfile=91bd0c092128cf2e60e1a608c31e92caf1f9c1595f83f2890ef17c0e4881aa0a
Hex40="[a-f0-9]"
Hex40=$Hex40$Hex40$Hex40$Hex40$Hex40$Hex40$Hex40$Hex40
Hex40=$Hex40$Hex40$Hex40$Hex40$Hex40 # Match SHA-1 hexdigest
+GPG="$(git config --get "gpg.program" '.+' || echo gpg)"
Did_find_repo= # yes for connected, no for no repo
Localdir="${GIT_DIR:=.git}/remote-gcrypt"
@@ -371,9 +372,9 @@ rungpg()
# due to trying to print messages to it, even if a gpg agent is set
# up. --no-tty fixes this.
if [ "x$GPG_AGENT_INFO" != "x" ]; then
- gpg --no-tty "$@"
+ ${GPG} --no-tty "$@"
else
- gpg "$@"
+ ${GPG} "$@"
fi
}