From: Eric Wong Date: Mon, 28 Nov 2022 05:31:48 +0000 (+0000) Subject: lei_mirror: force --no-tags when fetching forkgroups X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=d58adce592aa4fa719d095b6f3f05665a2f7b394 lei_mirror: force --no-tags when fetching forkgroups We can't have multiple remotes writing to refs/tags/* (instead of refs/remotes/*/tags) due to potential conflicts. --- diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 21341efb..d6aca800 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -375,7 +375,7 @@ sub fgrp_fetched { sub fgrp_fetch { my ($fgrp, $fini) = @_; my $cmd = [ @{$fgrp->{-torsocks}}, 'git', "--git-dir=$fgrp->{-osdir}", - fetch_args($fgrp->{lei}, my $opt = {}), + fetch_args($fgrp->{lei}, my $opt = {}), '--no-tags', $fgrp->{-remote} ]; $fgrp->{-fini} = $fini; do_reap($fgrp); @@ -405,7 +405,9 @@ sub forkgroup_prep { my $key = $self->{-key} // die 'BUG: no -key'; my ($bn) = ($key =~ m{/([a-z0-9_,;=!\+\{\}\|][^/]*)(?:\.git)?\z}i); my $rn = "$bn-".substr(sha256_hex($key), 0, 16); - for ("url=$uri", "fetch=+refs/*:refs/remotes/$rn/*") { + # --no-tags is required to avoid conflicts + for ("url=$uri", "fetch=+refs/*:refs/remotes/$rn/*", + 'tagopt=--no-tags') { my @kv = split(/=/, $_, 2); $kv[0] = "remote.$rn.$kv[0]"; run_die([@cmd, @kv], undef, $opt);