my ($self) = @_;
my @cmd = qw(config);
if ($self->{version} == 2) {
- push @cmd, "--file=$self->{mainrepo}/inbox-config";
+ push @cmd, "--file=$self->{mainrepo}/all.git/config";
}
my $fh = $self->{git}->popen(@cmd, 'core.sharedRepository');
local $/ = "\n";
die "$git_dir exists\n" if -e $git_dir;
my @cmd = (qw(git init --bare -q), $git_dir);
PublicInbox::Import::run_die(\@cmd);
- @cmd = (qw/git config/, "--file=$git_dir/config",
- 'repack.writeBitmaps', 'true');
- PublicInbox::Import::run_die(\@cmd);
my $all = "$self->{-inbox}->{mainrepo}/all.git";
unless (-d $all) {
@cmd = (qw(git init --bare -q), $all);
PublicInbox::Import::run_die(\@cmd);
+ @cmd = (qw/git config/, "--file=$all/config",
+ 'repack.writeBitmaps', 'true');
+ PublicInbox::Import::run_die(\@cmd);
}
+ @cmd = (qw/git config/, "--file=$git_dir/config",
+ 'include.path', '../../all.git/config');
+ PublicInbox::Import::run_die(\@cmd);
+
my $alt = "$all/objects/info/alternates";
my $new_obj_dir = "../../git/$new.git/objects";
my %alts;
ok(-d "$tmpdir/v2list", 'v2list directory exists');
ok(-f "$tmpdir/v2list/msgmap.sqlite3", 'msgmap exists');
ok(-d "$tmpdir/v2list/all.git", 'catch-all.git directory exists');
+ @cmd = (qw(git config), "--file=$tmpdir/v2list/all.git/config",
+ qw(core.sharedRepository 0644));
}
done_testing();
my $im = PublicInbox::V2Writable->new($ibx, 1);
ok($im->add($mime), 'ordinary message added');
+
+if ('ensure git configs are correct') {
+ my @cmd = (qw(git config), "--file=$mainrepo/all.git/config",
+ qw(core.sharedRepository 0644));
+ is(system(@cmd), 0, "set sharedRepository in all.git");
+ my $git0 = PublicInbox::Git->new("$mainrepo/git/0.git");
+ my $fh = $git0->popen(qw(config core.sharedRepository));
+ my $v = eval { local $/; <$fh> };
+ chomp $v;
+ is($v, '0644', 'child repo inherited core.sharedRepository');
+ $fh = $git0->popen(qw(config --bool repack.writeBitmaps));
+ $v = eval { local $/; <$fh> };
+ chomp $v;
+ is($v, 'true', 'child repo inherited repack.writeBitmaps');
+}
+
{
my @warn;
local $SIG{__WARN__} = sub { push @warn, @_ };