]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_mirror: force --no-tags when fetching forkgroups
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:31:48 +0000 (05:31 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:56 +0000 (23:38 +0000)
We can't have multiple remotes writing to refs/tags/*
(instead of refs/remotes/*/tags) due to potential conflicts.

lib/PublicInbox/LeiMirror.pm

index 21341efb99ab32d85f2a008767c974de4d3356b3..d6aca800d479298b71d363241a4d0ebf71c8f957 100644 (file)
@@ -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);