From 3a9e5a9357b6b0cac2acdefa203136c9b572e102 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 15 Feb 2012 08:46:09 +0200 Subject: [PATCH] Show current commit id in branch/tag select --- app/helpers/application_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 63216e8f..0d435059 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