Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/gitlab/graph_helper.rb')
-rw-r--r--app/helpers/gitlab/graph_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/gitlab/graph_helper.rb b/app/helpers/gitlab/graph_helper.rb
new file mode 100644
index 00000000000..047f5c19095
--- /dev/null
+++ b/app/helpers/gitlab/graph_helper.rb
@@ -0,0 +1,18 @@
+module Gitlab
+ module GraphHelper
+ def get_refs(repo, commit)
+ refs = ""
+ refs << commit.ref_names(repo).join(' ')
+
+ # append note count
+ refs << "[#{@graph.notes[commit.id]}]" if @graph.notes[commit.id] > 0
+
+ refs
+ end
+
+ def parents_zip_spaces(parents, parent_spaces)
+ ids = parents.map { |p| p.id }
+ ids.zip(parent_spaces)
+ end
+ end
+end