Detect empty git tag in cmpVERSION
authorHugo van der Sanden <hv@crypt.org>
Fri, 2 Nov 2012 10:39:34 +0000 (10:39 +0000)
committerHugo van der Sanden <hv@crypt.org>
Fri, 2 Nov 2012 10:41:32 +0000 (10:41 +0000)
Porting/cmpVERSION.pl

index 97c78b2..36128bb 100755 (executable)
@@ -43,6 +43,13 @@ unless (defined $tag_to_compare) {
     chomp $tag_to_compare;
 }
 
+unless (length $tag_to_compare) {
+    die "$0: Git found, but no Git tags found\n"
+       unless $tap;
+    print "1..0 # SKIP: Git found, but no Git tags found\n";
+    exit 0;
+}
+
 my $tag_exists = `git --no-pager tag -l $tag_to_compare 2>$null`;
 chomp $tag_exists;