From: Graham Knop <haarg@haarg.org>
Date: Thu, 5 Sep 2013 03:41:14 +0000 (-0400)
Subject: test that VERSION has been changed earlier
X-Git-Tag: v0.002000~34
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a973b0682abbbc0427e529db98412070cf507d92;p=p5sagit%2FDistar.git

test that VERSION has been changed earlier
---

diff --git a/lib/Distar.pm b/lib/Distar.pm
index a0d126c..c3d9453 100644
--- a/lib/Distar.pm
+++ b/lib/Distar.pm
@@ -63,11 +63,14 @@ sub run_preflight {
   $Ran_Preflight = 1;
   my $version = $ARGV[0];
 
-  system("git fetch");
-
   my $make = $Config{make};
   my $null = File::Spec->devnull;
 
+  system("git fetch");
+  if (system("git rev-parse --quiet --verify v$version >$null") == 0) {
+    die "Tag v$version already exists!";
+  }
+
   require File::Find;
   File::Find::find({ no_chdir => 1, wanted => sub {
     return