my ($self) = @_;
$self->{search} ||= eval {
_weaken_later($self);
- PublicInbox::Search->new($self->{mainrepo});
+ PublicInbox::Search->new($self->{mainrepo}, $self->{altid});
};
}
my $desc = $self->{description};
return $desc if defined $desc;
$desc = try_cat("$self->{mainrepo}/description");
+ local $/ = "\n";
chomp $desc;
$desc =~ s/\s+/ /smg;
$desc = '($GIT_DIR/description missing)' if $desc eq '';
return $url if $url;
$url = try_cat("$self->{mainrepo}/cloneurl");
my @url = split(/\s+/s, $url);
+ local $/ = "\n";
chomp @url;
$self->{cloneurl} = \@url;
}
$str;
}
+sub msg_by_smsg ($$;$) {
+ my ($self, $smsg, $ref) = @_;
+
+ # backwards compat to fallback to msg_by_mid
+ # TODO: remove if we bump SCHEMA_VERSION in Search.pm:
+ defined(my $blob = $smsg->blob) or return msg_by_mid($self, $smsg->mid);
+
+ my $str = git($self)->cat_file($blob, $ref);
+ $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str;
+ $str;
+}
+
sub path_check {
my ($self, $path) = @_;
git($self)->check('HEAD:'.$path);