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-08-14 13:38:08 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-08-14 13:57:56 +0300
commita175966677edc385156eb9dab79d129ece0bb87f (patch)
tree7134d30e40bff531fa63ef311303fdcd3dd7320b /lib/gitlab/gpg.rb
parent2c17853ac718dd516875d44da567665ed1081746 (diff)
reset original directory in ensure
Diffstat (limited to 'lib/gitlab/gpg.rb')
-rw-r--r--lib/gitlab/gpg.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/gitlab/gpg.rb b/lib/gitlab/gpg.rb
index 78ebd8866a1..45e9f9d65ae 100644
--- a/lib/gitlab/gpg.rb
+++ b/lib/gitlab/gpg.rb
@@ -68,17 +68,13 @@ module Gitlab
private
def optimistic_using_tmp_keychain
+ previous_dir = current_home_dir
Dir.mktmpdir do |dir|
- previous_dir = current_home_dir
-
GPGME::Engine.home_dir = dir
-
- return_value = yield
-
- GPGME::Engine.home_dir = previous_dir
-
- return_value
+ yield
end
+ ensure
+ GPGME::Engine.home_dir = previous_dir
end
end
end