-$new = PublicInbox::Inbox->new($new);
-my $v2w = PublicInbox::V2Writable->new($new, 1);
-$v2w->init_inbox($jobs);
+$new = PublicInbox::InboxWritable->new($new);
+my $v2w;
+$old->umask_prepare;
+$old->with_umask(sub {
+ local $ENV{GIT_CONFIG} = "$old->{mainrepo}/config";
+ $v2w = PublicInbox::V2Writable->new($new, 1);
+ $v2w->init_inbox($jobs);
+ chomp(my $sr = $old->git->qx('config', 'core.sharedRepository'));
+ if ($sr ne '') {
+ PublicInbox::Import::run_die(['git', 'config',
+ "--file=$new->{mainrepo}/all.git/config",
+ 'core.sharedRepository', $sr]);
+ }
+});