提交 1d782b03 编写于 作者: J Jakub Narebski 提交者: Junio C Hamano

gitweb: Make git_get_hash_by_path check type if provided

Signed-off-by: NJakub Narebski <jnareb@gmail.com>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 16fdb488
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册