use Carp qw(croak);
use File::Path ();
use PublicInbox::MiscSearch;
+use PublicInbox::Config;
sub new {
my ($class, $eidx) = @_;
}
}
index_text($self, $ibx->{name}, 1, 'XNAME');
+ my $data = {};
+ if (defined(my $max = $ibx->max_git_epoch)) { # v2
+ my $desc = $ibx->description;
+ my $pfx = "/$ibx->{name}/git/";
+ for my $epoch (0..$max) {
+ my $git = $ibx->git_epoch($epoch) or return;
+ if (my $ent = $git->manifest_entry($epoch, $desc)) {
+ $data->{"$pfx$epoch.git"} = $ent;
+ $ent->{git_dir} = $git->{git_dir};
+ }
+ $git->cleanup; # ->modified starts cat-file --batch
+ }
+ } elsif (my $ent = $ibx->git->manifest_entry) { # v1
+ $ent->{git_dir} = $ibx->{inboxdir};
+ $data->{"/$ibx->{name}"} = $ent;
+ }
+ $doc->set_data(PublicInbox::Config::json()->encode($data));
if (defined $docid) {
$xdb->replace_document($docid, $doc);
} else {