X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiMirror.pm;h=afe12bb30dd719e545224b348575ff52b82b3f92;hb=0830817c132cb105291104937a645d30efe06db1;hp=4c564c84f5b1db2055e66d1636a387fa299cdfb5;hpb=b58cb3f73d48f682eb2092f7ae758cdad70c5467;p=public-inbox.git diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 4c564c84..afe12bb3 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -259,7 +259,8 @@ sub run_reap { sub start_cmd { my ($self, $cmd, $opt, $fini) = @_; do_reap($self); - $self->{lei}->qerr("# @$cmd"); + utf8::decode(my $msg = "# @$cmd"); + $self->{lei}->qerr($msg); return if $self->{dry_run}; $LIVE->{spawn($cmd, undef, $opt)} = [ \&reap_cmd, $self, $cmd, $fini ] } @@ -507,12 +508,9 @@ sub resume_fetch { my $dst = $self->{cur_dst} // $self->{dst}; my @git = ('git', "--git-dir=$dst"); my $opt = { 2 => $self->{lei}->{2} }; - my $rn = 'origin'; # configurable? + my $rn = 'random'.int(rand(1 << 30)); for ("url=$uri", "fetch=+refs/*:refs/*", 'mirror=true') { - my @kv = split(/=/, $_, 2); - $kv[0] = "remote.$rn.$kv[0]"; - next if $self->{dry_run}; - run_die([@git, 'config', @kv], undef, $opt); + push @git, '-c', "remote.$rn.$_"; } my $cmd = [ @{$self->{-torsocks}}, @git, fetch_args($self->{lei}, $opt), $rn ];