X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FImport.pm;h=95d654f667221711de6897ffd632b197bd6d10cf;hb=6ae5319be740b48370f32fe043d112bf09dd18da;hp=c72c1e9224990047e9f4c3a8b88850655a5348fe;hpb=b5bc3576af3d0ef0fa884ed32a674c7a703a19b2;p=public-inbox.git diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index c72c1e92..95d654f6 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -440,14 +440,31 @@ sub run_die ($;$$) { $? == 0 or die join(' ', @$cmd) . " failed: $?\n"; } +my @INIT_FILES = ('HEAD' => "ref: refs/heads/master\n", + 'description' => < <{git}->{git_dir} if ref($dir); + require File::Path; + File::Path::mkpath([ map { "$dir/$_" } qw(objects/info refs/heads) ]); + for (my $i = 0; $i < @INIT_FILES; $i++) { + my $f = $dir.'/'.$INIT_FILES[$i++]; + next if -f $f; + open my $fh, '>', $f or die "open $f: $!"; + print $fh $INIT_FILES[$i] or die "print $f: $!"; + close $fh or die "close $f: $!"; + } } sub done {