- if ($mm) {
- $dbh->begin_work;
- my $lm = $mm->last_commit || '';
- if ($lm eq $lx) {
- # Common case is the indexes are synced,
- # we only need to run git-log once:
- rlog($self, $xlog, *index_both, *unindex_both, $cb);
- } else {
- # Uncommon case, msgmap and xapian are out-of-sync
- # do not care for performance (but git is fast :>)
- # This happens if we have to reindex Xapian since
- # msgmap is a frozen format and our Xapian format
- # is evolving.
- my $r = $lm eq '' ? $tip : "$lm..$tip";
-
- # first, ensure msgmap is up-to-date:
- my $mkey_prev = $mkey;
- $mkey = undef; # ignore xapian, for now
- my $mlog = _git_log($self, $r);
- $mm_only = 1;
- rlog($self, $mlog, *index_mm, *unindex_mm, $cb);
- $mm_only = $mlog = undef;
-
- # now deal with Xapian
- $mkey = $mkey_prev;
- $dbh = undef;
- rlog($self, $xlog, *index_mm2, *unindex_mm2, $cb);
- }
- } else {
- # user didn't install DBD::SQLite and DBI
- rlog($self, $xlog, *add_message, *unindex_blob, $cb);
- }