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.
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"
# 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
}