summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGuilherme Vieira <guilherme@flipstudio.net>2017-10-01 11:54:12 -0300
committerGuilherme Vieira <guilherme@flipstudio.net>2017-10-18 23:41:00 -0200
commitada114065f332bb7d4add3156dd177eaf6662aaa (patch)
tree5d29b75e920de22a3e07048808734ad526a1f8dd /app
parent6c33fb846683ca9213dadaa79b0f32f482ebc0bf (diff)
downloadgitlab-ce-ada114065f332bb7d4add3156dd177eaf6662aaa.tar.gz
Renders 404 in commits controller if no commits are found
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/commits_controller.rb2
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]