Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-02-28 17:25:12 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:42:04 +0300
commit8bd94a7304d392ad030295b5dfcd84c0100eddd1 (patch)
tree0e08bcdb460ad21c25646f686a42f4b743bf0129 /lib/gitlab/gpg.rb
parentc1281982bd7975b45bed5b8e2c5ef5e242ea18fd (diff)
remove gpg from keychain when user's email changes
Diffstat (limited to 'lib/gitlab/gpg.rb')
-rw-r--r--lib/gitlab/gpg.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/gpg.rb b/lib/gitlab/gpg.rb
index f478f1ae5d8..ee0467ae264 100644
--- a/lib/gitlab/gpg.rb
+++ b/lib/gitlab/gpg.rb
@@ -10,7 +10,9 @@ module Gitlab
end
def remove(fingerprint)
- GPGME::Key.get(fingerprint).delete!
+ # `#get` raises an EOFError if the keychain is empty, which is why we
+ # use the friendlier `#find`
+ GPGME::Key.find(:public, fingerprint).each(&:delete!)
end
def emails(fingerprint)