- my $tagref = "refs/tags/".debiantag $vsn, $distro;
- printdebug " checking history vsn=$vsn tagref=$tagref\n";
- $?=0; my $r = system qw(git show-ref --verify --quiet), $tagref;
- return 1 if !$r;
- return 0 if $r==256;
- die "$pkg tagref $tagref $? $!";
+ # Eventually, when we withdraw support for old-format (DEP-14
+ # namespace) tags, we will need to change this to only look
+ # for debiantag_new. See the commit
+ # "Tag change: Update dgit-repos-policy-debian"
+ # (reverting which is a good start for that change).
+
+ my @tagrefs = map { "refs/tags/".$_ } debiantags $vsn, $distro;
+ printdebug " checking history vsn=$vsn tagrefs=@tagrefs\n";
+ open F, "-|", qw(git-for-each-ref), @tagrefs;
+ $_ = <F>;
+ close F;
+ return 1 if defined && m/\S/;
+ die "$pkg tagrefs @tagrefs $? $!" if $?;
+ return 0;