]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
read_config: only pick first key for each key id
authorroot <root@localhost>
Thu, 24 Jan 2013 17:17:56 +0000 (17:17 +0000)
committerroot <root@localhost>
Thu, 24 Jan 2013 17:17:56 +0000 (17:17 +0000)
git-remote-gcrypt

index e12d3551cb85381e884f1360c4801774a386f5b3..df00ddc7125d893795d72339191ecc8c51b6fb50 100755 (executable)
@@ -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_" &&