Graph: small refactoring
This commit is contained in:
parent
c89682605f
commit
dc844f0138
2 changed files with 6 additions and 10 deletions
|
@ -181,7 +181,10 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def add_refs(commit, ref_cache)
|
||||
if ref_cache.empty?
|
||||
@repo.refs.each {|ref| ref_cache[ref.commit.id] ||= [];ref_cache[ref.commit.id] << ref}
|
||||
@repo.refs.each do |ref|
|
||||
ref_cache[ref.commit.id] ||= []
|
||||
ref_cache[ref.commit.id] << ref
|
||||
end
|
||||
end
|
||||
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
|
||||
commit.refs ||= []
|
||||
|
|
|
@ -72,11 +72,4 @@ class GraphCommit
|
|||
marks.compact.max
|
||||
end
|
||||
|
||||
def self.add_refs(commit, ref_cache)
|
||||
if ref_cache.empty?
|
||||
@repo.refs.each {|ref| ref_cache[ref.commit.id] ||= [];ref_cache[ref.commit.id] << ref}
|
||||
end
|
||||
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
|
||||
commit.refs ||= []
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue