diff --git a/git2spec.pl b/git2spec.pl index 7853791e..9ddc3805 100755 --- a/git2spec.pl +++ b/git2spec.pl @@ -37,7 +37,7 @@ $tag=`git describe --abbrev=0 --tags` if not defined $tag; chomp($tag); my @patches=&create_patches($tag, $pdir); my $num=$#patches + 2; -$tag=~s/[^0-9]+?([0-9]+)/$1/; +$tag=~s/[^0-9]+?([0-9]+)/$1/ if $tag !~ /\b[0-9a-f]{5,40}\b/; my $release="$num.git$datestr"; $release="1" if $num == 1;