diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-10-19 12:18:42 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-10-19 12:18:42 +0000 |
commit | 228bbb3af03f386b26cedd336ad5d95b0da91508 (patch) | |
tree | 7a3b78bd7558b34c409a7d0dec74ac2fed51331c /app/controllers | |
parent | ac782f562dbd9adba42f5ee1d2c3c997f75a95b9 (diff) | |
parent | ada114065f332bb7d4add3156dd177eaf6662aaa (diff) | |
download | gitlab-ce-228bbb3af03f386b26cedd336ad5d95b0da91508.tar.gz |
Merge branch 'not-found-in-commits' into 'master'
Renders 404 in commits controller if no commits are found
Closes #37620
See merge request gitlab-org/gitlab-ce!14610
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/commits_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 4a841bf2073..d48284a4429 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -48,6 +48,8 @@ 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? + @limit, @offset = (params[:limit] || 40).to_i, (params[:offset] || 0).to_i search = params[:search] |