chiark / gitweb /
git fetching: git_lrfetch_sane: Tidy up old suite-based refs
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 1fdc26c13b0d3a379f8950460df11783665a3521..8c9765e38c39658e3bb776f4a365080f800bd1e8 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2673,6 +2673,16 @@ END
        }
        last;
     }
+
+    if (defined $csuite) {
+       printdebug "git_lrfetch_sane: tidying any old suite lrfetchrefs\n";
+       git_for_each_ref("refs/dgit-fetch/$csuite", sub {
+           my ($objid,$objtype,$lrefname,$reftail) = @_;
+           next if $lrfetchrefs_f{$lrefname}; # $csuite eq $distro ?
+           runcmd_ordryrun_local @git, qw(update-ref -d), $lrefname;
+       });
+    }
+
     printdebug "git_lrfetch_sane: git fetch --no-insane emulation complete\n",
        Dumper(\%lrfetchrefs_f);
 }