From 5ed21119f63cc85087f70aa6c634f0518b647a56 Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Sun, 5 May 2013 23:31:54 -0300 Subject: [PATCH] Better behavior when dealing with repositories with empty commits, see #319 --- src/GitList/Util/Routing.php | 5 ----- views/tree.twig | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/GitList/Util/Routing.php b/src/GitList/Util/Routing.php index 7e67c29..e12d283 100644 --- a/src/GitList/Util/Routing.php +++ b/src/GitList/Util/Routing.php @@ -71,11 +71,6 @@ class Routing $path = substr($path, 1); } - $commitHasPath = $repository->pathExists($commitish, $path); - if ($commitHasPath !== true) { - $app->abort(404, "\"$path\" does not exist in \"$commitish\"."); - } - return array($commitish, $path); } diff --git a/views/tree.twig b/views/tree.twig index 9dfa8a5..a33bbb4 100644 --- a/views/tree.twig +++ b/views/tree.twig @@ -17,6 +17,7 @@ {% endblock %} {% endembed %} + {% if files is not empty %} @@ -54,6 +55,9 @@ {% endfor %}
+ {% else %} +

This repository is empty.

+ {% endif %} {% if readme is defined and readme is not empty %}