Commit 8ab0fcee authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '40273_404_on_commits_page_when_all_files_on_branch_deleted' into 'master'

Fix 404 on commits list for branch that doesn't have any files

See merge request gitlab-org/gitlab-ce!15603
parents 420cdc6a d1e00b1e
......@@ -45,8 +45,7 @@ class Projects::CommitsController < Projects::ApplicationController
private
def set_commits
render_404 unless request.format == :atom || @repository.blob_at(@commit.id, @path) || @repository.tree(@commit.id, @path).entries.present?
render_404 unless @path.empty? || request.format == :atom || @repository.blob_at(@commit.id, @path) || @repository.tree(@commit.id, @path).entries.present?
@limit, @offset = (params[:limit] || 40).to_i, (params[:offset] || 0).to_i
search = params[:search]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment