Commit 3a4c1c5c authored by Sato Hiroyuki's avatar Sato Hiroyuki

Enable to filter graph by ref

parent c0e3b397
...@@ -16,7 +16,7 @@ class GraphController < ProjectResourceController ...@@ -16,7 +16,7 @@ class GraphController < ProjectResourceController
format.html format.html
format.json do format.json do
@graph = Network::Graph.new(project, @ref, @commit) @graph = Network::Graph.new(project, @ref, @commit, @options[:filter_ref])
end end
end end
end end
......
...@@ -8,10 +8,11 @@ module Network ...@@ -8,10 +8,11 @@ module Network
@max_count ||= 650 @max_count ||= 650
end end
def initialize project, ref, commit def initialize project, ref, commit, filter_ref
@project = project @project = project
@ref = ref @ref = ref
@commit = commit @commit = commit
@filter_ref = filter_ref
@repo = project.repo @repo = project.repo
@commits = collect_commits @commits = collect_commits
...@@ -107,7 +108,9 @@ module Network ...@@ -107,7 +108,9 @@ module Network
skip: skip skip: skip
} }
Grit::Commit.find_all(@repo, nil, opts) ref = @ref if @filter_ref
Grit::Commit.find_all(@repo, ref, opts)
end end
def commits_sort_by_ref def commits_sort_by_ref
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment