Skip to contentSkip to conversation

gitweb: fix display of trees via PATH_INFO.

PATCH In review Martin Waitz 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: fix display of trees via PATH_INFO.

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

---
 gitweb/gitweb.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
gitweb/gitweb.perl +1 -0
index baadbe7..ea57717 100755
@@ -300,6 +300,7 @@ sub evaluate_path_info {
 		$pathname =~ s,^/+,,;
 		if (!$pathname || substr($pathname, -1) eq "/") {
 			$action  ||= "tree";
+			$pathname =~ s,/$,,;
 		} else {
 			$action  ||= "blob_plain";
 		}
Signature · 4 lines
1.4.2.gb8b6b

-- 
Martin Waitz
#1 lore raw
Quoted 2 lines · Martin Waitz

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.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git