diff options
author | Phil Hughes <me@iamphill.com> | 2016-06-20 11:37:27 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-06-20 11:37:27 +0100 |
commit | f112e2a1da696905e994bf5c37c10a950779b1a9 (patch) | |
tree | d4b42a4b7c959bf6b742fd7e87b76f4a3d7493dd /app/controllers | |
parent | c240cad59a84e090e12d7ce6db94983405aa1813 (diff) | |
download | gitlab-ce-async-refs-dropdown.tar.gz |
Fixed issue with returning ref in commits JSONasync-refs-dropdown
Added tests to project controller
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b65730b37c9..78ceaf3237f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,7 +1,7 @@ class ProjectsController < Projects::ApplicationController include ExtractsPath - before_action :authenticate_user!, except: [:show, :activity] + before_action :authenticate_user!, except: [:show, :activity, :refs] before_action :project, except: [:new, :create] before_action :repository, except: [:new, :create] before_action :assign_ref_vars, :tree, only: [:show], if: :repo_exists? @@ -261,8 +261,8 @@ class ProjectsController < Projects::ApplicationController end # If reference is commit id - we should add it to branch/tag selectbox - ref = params[:ref] - if ref && options.flatten.exclude?(ref) && ref =~ /\A[0-9a-zA-Z]{6,52}\z/ + ref = Addressable::URI.unescape(params[:ref]) + if ref && options.flatten(2).exclude?(ref) && ref =~ /\A[0-9a-zA-Z]{6,52}\z/ options['Commits'] = [ref] end |