aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-09-21 18:09:12 +0200
committerJunio C Hamano <junkio@cox.net>2006-09-21 12:55:51 -0700
commit1d782b03b078c1a525cbb5728f6dc5eb06f06924 (patch)
tree3e1acf04f7e6a08e49374baab888568b3510c762 /gitweb
parent16fdb4882e3f7b5b60907a2729df494aaa1410a3 (diff)
downloadgit-1d782b03b078c1a525cbb5728f6dc5eb06f06924.tar.gz
git-1d782b03b078c1a525cbb5728f6dc5eb06f06924.tar.xz
gitweb: Make git_get_hash_by_path check type if provided
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fb8d37eb7..d3757f49b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/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;
}