summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-11-20 13:48:33 -0600
committerEric Eastwood <contact@ericeastwood.com>2017-11-20 14:17:39 -0600
commit2d980cb71c952483da3cffe2ea368a6904c9a0a5 (patch)
treedfef7c523d0abc6fc09a700ffdb959c535ac2896
parentd41e66cb632cf4a51428c87a07cbdd182e3e0697 (diff)
downloadgitlab-ce-39821-fix-commits-list-with-multi-file-editor.tar.gz
Fix commits list 500 with multi-file editor new_repo cookie39821-fix-commits-list-with-multi-file-editor
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/39821 /<namespace>/<project>/commmits/master
-rw-r--r--app/views/shared/_ref_switcher.html.haml2
-rw-r--r--changelogs/unreleased/39821-fix-commits-list-with-multi-file-editor.yml5
-rw-r--r--spec/features/commits_spec.rb7
3 files changed, 14 insertions, 0 deletions
diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml
index 6356e9f92cb..f4a4bfaec54 100644
--- a/app/views/shared/_ref_switcher.html.haml
+++ b/app/views/shared/_ref_switcher.html.haml
@@ -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
diff --git a/changelogs/unreleased/39821-fix-commits-list-with-multi-file-editor.yml b/changelogs/unreleased/39821-fix-commits-list-with-multi-file-editor.yml
new file mode 100644
index 00000000000..8b27c43d15b
--- /dev/null
+++ b/changelogs/unreleased/39821-fix-commits-list-with-multi-file-editor.yml
@@ -0,0 +1,5 @@
+---
+title: Fix commits page throwing 500 when the multi-file editor was enabled
+merge_request: 15502
+author:
+type: fixed
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb
index 479fb713297..1e83137f8a9 100644
--- a/spec/features/commits_spec.rb
+++ b/spec/features/commits_spec.rb
@@ -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