]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Strip trailing slashes from $path in git_get_hash_by_path
authorJakub Narebski <redacted>
Mon, 25 Sep 2006 23:54:24 +0000 (01:54 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
It also removes unused local variable $tree

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 932f15eb459a08b4730f27c89ac650bd07c48baa71444e4bfb92d7e424376631..d6f9bae033342a9a4e06ece913480768b19f00a31bb8c280fe709aeeffbb9206 100755 (executable)
@@ -710,7 +710,7 @@ sub git_get_hash_by_path {
        my $path = shift || return undef;
        my $type = shift;
 
        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");
 
        open my $fd, "-|", git_cmd(), "ls-tree", $base, "--", $path
                or die_error(undef, "Open git-ls-tree failed");
This page took 0.26316 seconds and 4 git commands to generate.