# [PATCH] gitweb: fix display of trees via PATH_INFO.

2 messages from 2006-09-21 to 2006-09-21. Participants: Martin Waitz, Jakub Narebski.
Thread: https://gitlist.dev/t/5636

## Martin Waitz, 2006-09-21 07:48

Subject: [PATCH] gitweb: fix display of trees via PATH_INFO.
Message-ID: <20060921074821.GG31940@admingilde.org>
URL: https://gitlist.dev/e/20060921074821.GG31940%40admingilde.org

```
When adding a / to the URL, git should display the corresponding
tree object, but it has to remove the / first.

Signed-off-by: Martin Waitz <tali@admingilde.org>
---
 gitweb/gitweb.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index baadbe7..ea57717 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -300,6 +300,7 @@ sub evaluate_path_info {
 		$pathname =~ s,^/+,,;
 		if (!$pathname || substr($pathname, -1) eq "/") {
 			$action  ||= "tree";
+			$pathname =~ s,/$,,;
 		} else {
 			$action  ||= "blob_plain";
 		}
-- 
1.4.2.gb8b6b

-- 
Martin Waitz

```

## Jakub Narebski, 2006-09-21 08:56

Subject: Re: [PATCH] gitweb: fix display of trees via PATH_INFO.
Message-ID: <eetk3v$22n$2@sea.gmane.org>
URL: https://gitlist.dev/e/eetk3v%2422n%242%40sea.gmane.org
In-Reply-To: <20060921074821.GG31940@admingilde.org>

```
Martin Waitz wrote:

> When adding a / to the URL, git should display the corresponding
> tree object, but it has to remove the / first.

Hmm... I thought that gitweb works just fine with file_name ('f') parameter
with trailing '/'... I guessed wrong.

By the way, we should fix error when we try to "tree" display blob, or
"blob" display tree.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```
