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)
|
def add_refs(commit, ref_cache)
|
||||||
if ref_cache.empty?
|
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
|
end
|
||||||
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
|
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
|
||||||
commit.refs ||= []
|
commit.refs ||= []
|
||||||
|
|
|
@ -72,11 +72,4 @@ class GraphCommit
|
||||||
marks.compact.max
|
marks.compact.max
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue