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:
authorAndrey Kumanyaev <me@zzet.org>2013-10-15 16:59:48 +0400
committerAndrey Kumanyaev <me@zzet.org>2013-10-21 22:54:37 +0400
commit6173d0a92f4b8e472d5d71e3518ae5460257d39e (patch)
tree0024506e1b22d7f6e417587a00d3fb4bc4fc80c0 /app/helpers/commits_helper.rb
parent5717304098ae81285a5a616fb066e9ae7ea88f54 (diff)
Show branches list (which branches contains commit) on commit page
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r--app/helpers/commits_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 7e24cbd3e58..c340eb30be1 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -94,6 +94,17 @@ module CommitsHelper
crumbs.html_safe
end
+ # Return Project default branch, if it present in array
+ # Else - first branch in array (mb last actual branch)
+ def commit_default_branch(project, branches)
+ branches.include?(project.default_branch) ? branches.delete(project.default_branch) : branches.pop
+ end
+
+ # Returns the sorted alphabetically links to branches, separated by a comma
+ def commit_branches_links(project, branches)
+ branches.sort.map { |branch| link_to(branch, project_tree_path(project, branch)) }.join(", ").html_safe
+ end
+
protected
# Private: Returns a link to a person. If the person has a matching user and