From: Jakub Narebski Date: Thu, 21 Sep 2006 16:09:12 +0000 (+0200) Subject: gitweb: Make git_get_hash_by_path check type if provided X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/a8363e741f482dca53bb58c878bc879d6dc41b81bc7e6a9115c0ee4a8d1b25f3?ds=inline gitweb: Make git_get_hash_by_path check type if provided Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index a308c0a..8c30632 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -718,6 +718,7 @@ sub git_get_project_config { sub git_get_hash_by_path { my $base = shift; my $path = shift || return undef; + my $type = shift; my $tree = $base; @@ -728,6 +729,10 @@ sub git_get_hash_by_path { #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c' $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/; + if (defined $type && $type ne $2) { + # type doesn't match + return undef; + } return $3; }