summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-02-15 08:46:09 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-02-15 08:46:09 +0200
commit3a9e5a9357b6b0cac2acdefa203136c9b572e102 (patch)
treea89820692875e1e2a2bf232b4989037fa6a5aaa7
parent98f040a56f7f40613b12aebc2119bdd770ee2648 (diff)
downloadgitlab-ce-3a9e5a9357b6b0cac2acdefa203136c9b572e102.tar.gz
Show current commit id in branch/tag select
-rw-r--r--app/helpers/application_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 63216e8f7f0..0d435059fcb 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