Fix commits list 500 with multi-file editor new_repo cookie

Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/39821

/<namespace>/<project>/commmits/master
This commit is contained in:
Eric Eastwood 2017-11-20 13:48:33 -06:00
parent d41e66cb63
commit 2d980cb71c
3 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,5 @@
- show_create = local_assigns.fetch(:show_create, false)
- show_new_branch_form = show_new_repo? && show_create && can?(current_user, :push_code, @project)
- dropdown_toggle_text = @ref || @project.default_branch
= form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do

View File

@ -0,0 +1,5 @@
---
title: Fix commits page throwing 500 when the multi-file editor was enabled
merge_request: 15502
author:
type: fixed

View File

@ -202,5 +202,12 @@ describe 'Commits' do
expect(page).to have_content("committed #{commit.committed_date.strftime("%b %d, %Y")}")
end
end
it 'shows the ref switcher with the multi-file editor enabled', :js do
set_cookie('new_repo', 'true')
visit project_commits_path(project, branch_name)
expect(find('.js-project-refs-dropdown')).to have_content branch_name
end
end
end