make-version: use 0 as number of commits if they can't be obtained.

When running on gitlab-ci, the checkout of the project doesn't give
a complete repo. Then git describe fails at giving the number of commits.
In this case just use 0 instead of NULL.
This commit is contained in:
Dario Lombardo 2020-12-22 17:33:30 +01:00 committed by Wireshark GitLab Utility
parent 5227f385b8
commit 29b331bf0c
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ sub read_repo_info {
if ($? == 0 && length($line) > 1) {
my @parts = split(/-/, $line);
$git_description = $line;
$num_commits = $parts[-2];
$num_commits = $parts[-2] ? $parts[-2] : "0";
$commit_id = $parts[-1];
if ($line =~ /v\d+\.\d+\.\d+(rc\d+)-/) {