Skip to content

Commit

Permalink
Renamed class variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Apr 20, 2016
1 parent 2e1a75b commit 68b831e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/repository.rb
Expand Up @@ -22,7 +22,7 @@ def to_hash

class Repository
attr_reader :master, :path, :repo
@@jgit_repository = java.util.WeakHashMap.new
@@jgit_repo_cache = java.util.WeakHashMap.new

# Allow Repository instances to be created outside User context.
# These instances will only work with the canonical repo.
Expand Down Expand Up @@ -52,11 +52,11 @@ def initialize(master = nil)
end

def jgit_repo
result = @@jgit_repository.get(@path)
result = @@jgit_repo_cache.get(@path)
if result.nil? && exists?(@path)
begin
result = org.eclipse.jgit.storage.file.FileRepositoryBuilder.new.setGitDir(java.io.File.new(path)).readEnvironment().findGitDir().build()
@@jgit_repository.put(@path, result)
@@jgit_repo_cache.put(@path, result)
rescue Exception => e
Rails.logger.error("JGIT CorruptObjectException: #{e.inspect}\n#{e.backtrace.join("\n")}")
end
Expand All @@ -78,7 +78,7 @@ def create
# create a git repository
@repo ||= @canonical.fork_bare(path)
begin
@@jgit_repository.put(path, org.eclipse.jgit.storage.file.FileRepositoryBuilder.new.setGitDir(java.io.File.new(path)).readEnvironment().findGitDir().build())
@@jgit_repo_cache.put(path, org.eclipse.jgit.storage.file.FileRepositoryBuilder.new.setGitDir(java.io.File.new(path)).readEnvironment().findGitDir().build())
rescue Exception => e
Rails.logger.error("JGIT CorruptObjectException: #{e.inspect}\n#{e.backtrace.join("\n")}")
end
Expand Down

0 comments on commit 68b831e

Please sign in to comment.