From d1e00b1eb65a57b3103a882611d9ee03ce234d45 Mon Sep 17 00:00:00 2001 From: haseeb Date: Mon, 27 Nov 2017 13:36:02 +0000 Subject: Fix 404 on empty branch --- app/controllers/projects/commits_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 5f4afd2cdee..026708169f4 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -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] -- cgit v1.2.1