Code

gitweb: Strip trailing slashes from $path in git_get_hash_by_path
authorJakub Narebski <jnareb@gmail.com>
Mon, 25 Sep 2006 23:54:24 +0000 (01:54 +0200)
committerJunio C Hamano <junkio@cox.net>
Wed, 27 Sep 2006 07:41:35 +0000 (00:41 -0700)
It also removes unused local variable $tree

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index e769c8ed6c8f98127dcbefdef4dd3f6f09a7e6d0..4686d9376d05c69f29306eebc29c73ad12db1ecc 100755 (executable)
@@ -710,7 +710,7 @@ sub git_get_hash_by_path {
        my $path = shift || return undef;
        my $type = shift;
 
-       my $tree = $base;
+       $path =~ s,/+$,,;
 
        open my $fd, "-|", git_cmd(), "ls-tree", $base, "--", $path
                or die_error(undef, "Open git-ls-tree failed");