Subject: [PATCH] gitweb: Strip trailing slashes from $path in git_get_hash_by_path

From: Jakub Narebski <[email-masked]>
Date: Thu, 21 Sep 2006 14:23:29 +0200

Signed-off-by: Jakub Narebski <[email-masked]>
---
While
        git ls-tree $base -- dirname
shows dirname entry (that's what we want)
        git ls-tree $base -- dirname/
shows directory _contents_.

 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fb8d37e..403bba1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -719,7 +719,7 @@ sub git_get_hash_by_path {
 	my $base = shift;
 	my $path = shift || return undef;
 
-	my $tree = $base;
+	$path =~ s,/+$,,;
 
 	open my $fd, "-|", git_cmd(), "ls-tree", $base, "--", $path
 		or die_error(undef, "Open git-ls-tree failed");
-- 
1.4.2.1