aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-01-24 17:17:56 +0000
committerroot <root@localhost>2013-01-24 17:17:56 +0000
commit5e090e019bd05c03642a9074d07f703445d99d81 (patch)
tree00ac6bb0fcbd1f488795519d95ac57d448426f34
parentcd90cea0fe72e6bb1a8f2992b642b28398111ebb (diff)
downloadgit-remote-gcrypt-5e090e019bd05c03642a9074d07f703445d99d81.zip
git-remote-gcrypt-5e090e019bd05c03642a9074d07f703445d99d81.tar.gz
git-remote-gcrypt-5e090e019bd05c03642a9074d07f703445d99d81.tar.bz2
read_config: only pick first key for each key id
-rwxr-xr-xgit-remote-gcrypt3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index e12d355..df00ddc 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -364,6 +364,9 @@ read_config()
for recp_ in $conf_part
do
key_line=$(gpg --with-colons --fast-list -k "$recp_" | xgrep ^pub)
+ isnonnull "${key_line##*"$Newline"*}" ||
+ echo_info "WARNING: '$recp_' matches multiple keys, using one"
+ key_line=${key_line%%"$Newline"*}
keyid_=$(xecho "$key_line" | cut -f 5 -d :)
isnonnull "$keyid_" &&