From cbd13f06bf17357a9e160a6ae54a3f532e9eb068 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 19 Apr 2023 21:54:48 +0000 Subject: cindex: support sha256 coderepos alongside sha1 This special support is only needed for --prune at the moment since the indexing side works on a per-repo basis. There's no automated tests, yet, but it seems to work well on my sha256 projects when sharing a cindex with sha1 projects. --- lib/PublicInbox/Import.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 39719bcb..59462e9a 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -461,13 +461,21 @@ my @INIT_FILES = ('HEAD' => undef, # filled in at runtime EOC sub init_bare { - my ($dir, $head) = @_; # or self + my ($dir, $head, $fmt) = @_; # or self $dir = $dir->{git}->{git_dir} if ref($dir); require File::Path; File::Path::make_path(map { $dir.$_ } qw(/objects/info /refs/heads)); $INIT_FILES[1] //= 'ref: '.default_branch."\n"; my @fn_contents = @INIT_FILES; $fn_contents[1] = "ref: refs/heads/$head\n" if defined $head; + $fn_contents[3] = <