From 375b3ccfd3ca978281cb3869b62fc91eebc60d6e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Sep 2021 11:26:17 +0000 Subject: multi_git: hoist out common epoch/alternates handling IMHO, this greatly improves code sharing and organization between v2, extindex, and lei/store. Common git-related logic for these is lightly-refactored and easier to reason about. The impetus for this big change was to ensure inboxes created+managed by public-inbox-{clone,fetch} could have alternates and configs setup properly without depending on SQLite (via V2Writable). This change does that while making old code shorter and better factored. --- script/public-inbox-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'script/public-inbox-convert') diff --git a/script/public-inbox-convert b/script/public-inbox-convert index fec6b624..01af846a 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -179,7 +179,7 @@ if (my $old_mm = $old->mm) { $v2w->idx_init($opt); $v2w->{mm}->{dbh}->sqlite_backup_from_file($old_mm); - my $epoch0 = PublicInbox::Git->new($v2w->git_init(0)); + my $epoch0 = PublicInbox::Git->new($v2w->{mg}->add_epoch(0)); chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head)); $v2w->last_epoch_commit(0, $cmt); } -- cgit v1.2.3-24-ge0c7