From: Ian Jackson Date: Mon, 9 Jan 2017 00:20:21 +0000 (+0000) Subject: git fetching: git_lrfetch_sane: Tidy up old suite-based refs X-Git-Tag: archive/debian/3.0~31 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=88cd6864aec4140ee548ab3a3d318879fd7e9325 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 --- 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); }