summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-11-20 23:28:49 -0800
committerStan Hu <stanhu@gmail.com>2017-11-20 23:28:49 -0800
commitf80654c4e13ff42ca03bacb59b924b9960f59148 (patch)
treec2e01de8ae612d6adbbfbbbcccbf880cabe0be0e
parent9a8f094e34e9f6da5932f239a510abcd996a79b3 (diff)
downloadgitlab-ce-f80654c4e13ff42ca03bacb59b924b9960f59148.tar.gz
Memoize GitlabShellAdapter for performance and ease of testing
Port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3463#note_47990536
-rw-r--r--lib/gitlab/shell_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/shell_adapter.rb b/lib/gitlab/shell_adapter.rb
index fbe2a7a0d72..053dd4ab9e0 100644
--- a/lib/gitlab/shell_adapter.rb
+++ b/lib/gitlab/shell_adapter.rb
@@ -5,7 +5,7 @@
module Gitlab
module ShellAdapter
def gitlab_shell
- Gitlab::Shell.new
+ @gitlab_shell ||= Gitlab::Shell.new
end
end
end