threads / patch / 5636

patchgitweb: fix display of trees via PATH_INFO.

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

## tl;dr

2 messages between Sep 21, 2006 and Sep 21, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Martin Waitz· Sep 21, 2006, 07:48 UTC · lore

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(-)
Show changes to gitweb/gitweb.perl +1 −0
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· Sep 21, 2006, 08:56 UTC · re: Martin Waitz · lore

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

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

← back to recent threads