diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index 604407f5bce9efca0169518efdfe186d52eb6ae1..d4678b12df0589d75e686e9d7c61e06d52076c74 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -33,21 +33,22 @@ module Redmine
         end
 
         def branches
-          branches = []
+          return @branches if @branches
+          @branches = []
           cmd = "#{GIT_BIN} --git-dir #{target('')} branch"
           shellout(cmd) do |io|
             io.each_line do |line|
-              branches << line.match('\s*\*?\s*(.*)$')[1]
+              @branches << line.match('\s*\*?\s*(.*)$')[1]
             end
           end
-          branches.sort!
+          @branches.sort!
         end
 
         def tags
-          tags = []
+          return @tags if @tags
           cmd = "#{GIT_BIN} --git-dir #{target('')} tag"
           shellout(cmd) do |io|
-            io.readlines.sort!.map{|t| t.strip}
+            @tags = io.readlines.sort!.map{|t| t.strip}
           end
         end