From 272a3704ff3cc3d3fbb2df40a953068160b9f44b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Sep 2019 16:34:33 +0100 Subject: [PATCH] dgit: Fail early when the archive/ tag already exists. Suggest using a new version number. We need a new --force option to override this check. Closes: #935802 Signed-off-by: Ian Jackson --- dgit | 15 +++++++++++++++ dgit.1 | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/dgit b/dgit index 6f240ab0..56b2ee95 100755 --- a/dgit +++ b/dgit @@ -102,6 +102,7 @@ our %forceopts = map { $_=>0 } qw(unrepresentable unsupported-source-format dsc-changes-mismatch changes-origs-exactly uploading-binaries uploading-source-only + reusing-version import-gitapply-absurd import-gitapply-no-absurd import-dsc-with-dgit-field); @@ -4601,6 +4602,20 @@ END confess unless !!$made_split_brain == do_split_brain(); + my $tagname = debiantag_new $cversion, access_nomdistro(); + if (!(forceing[qw(reusing-version)]) && git_get_ref "refs/tags/$tagname") { + supplementary_message ''; + print STDERR f_ <