From 3201106edaaaa5859f8a4f1228e250f9f8968428 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 28 Jun 2019 14:19:25 +0100 Subject: [PATCH] infra: Drop support for old tag name on server side Signed-off-by: Ian Jackson --- infra/dgit-repos-server | 18 +++++++----------- tests/tests/drs-push-rejects | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index a8b9400b..7c7262f5 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -539,15 +539,12 @@ sub readupdates () { STDIN->error and die $!; reject "push is missing tag ref update" unless %tags; - my @newtags = grep { m#^archive/# } keys %tags; - my @omtags = grep { !m#^archive/# } keys %tags; - reject "pushing too many similar tags" if @newtags>1 || @omtags>1; - if (@newtags) { - ($tagname) = @newtags; - ($maint_tagname) = @omtags; - } else { - ($tagname) = @omtags or die; - } + my @dtags = grep { m#^archive/# } keys %tags; + reject "need exactly one archive/* tag" if @dtags!=1; + my @mtags = grep { !m#^archive/# } keys %tags; + reject "pushing too many non-dgit tags" if @mtags>1; + ($tagname) = @dtags; + ($maint_tagname) = @mtags; $tagval = $tags{$tagname}; $maint_tagval = $tags{$maint_tagname // ''}; @@ -862,8 +859,7 @@ sub checks () { grep { $tagname eq $_ } @expecttagnames or die; foreach my $othertag (grep { $_ ne $tagname } @expecttagnames) { - reject "tag $othertag (pushed with differing dgit version)". - " already exists -". + reject "tag $othertag already exists -". " not replacing previously-pushed version" if git_get_ref "refs/tags/".$othertag; } diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 4c4a0569..f102d953 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -110,7 +110,7 @@ mustfail 'push is missing tag ref update' $push_spec1 mustfail 'push is missing head ref update' +$push_spec2 mustfail 'pushing unexpected ref' $push_spec HEAD:refs/wombat mustfail 'pushing multiple heads' $push_spec HEAD:refs/dgit/wombat -mustfail E:'pushing multiple tags|pushing too many similar tags' \ +mustfail E:'pushing multiple tags|pushing too many similar tags|need exactly one archive' \ $push_spec HEAD:refs/tags/$tagpfx/wombat prep unstable sid -- 2.30.2