From: Dmitriy Zaporozhets Date: Wed, 15 Feb 2012 06:46:09 +0000 (+0200) Subject: Show current commit id in branch/tag select X-Git-Tag: v2.2.0pre~21 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3a9e5a9357b6b0cac2acdefa203136c9b572e102;p=wvm%2Fgitlab.git Show current commit id in branch/tag select --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 63216e8f7..0d435059f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -52,6 +52,13 @@ module ApplicationHelper [ "Tag", @project.tags ] ] + # If reference is commit id - + # we should add it to branch/tag selectbox + if(@ref && !options.include?(@ref) && + @ref =~ /^[0-9a-zA-Z]{6,52}$/) + options << ["Commit", [@ref]] + end + grouped_options_for_select(options, @ref || @project.default_branch) end