From 88cd6864aec4140ee548ab3a3d318879fd7e9325 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Jan 2017 00:20:21 +0000 Subject: [PATCH] git fetching: git_lrfetch_sane: Tidy up old suite-based refs We should look for these and delete them, when we have the chance, because otherwise nothing ever would. For now we just use $csuite if we have it, and otherwise do nothing. Signed-off-by: Ian Jackson --- dgit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dgit b/dgit index 1fdc26c1..8c9765e3 100755 --- 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); } -- 2.30.2