From 08d12526b1a05c1eb98f8eab172031f089d48329 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 8 Aug 2023 14:55:01 +0200 Subject: [PATCH] fix bug in branch parsing when being ahead of remote branch --- App/tools/getVersion.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/App/tools/getVersion.pl b/App/tools/getVersion.pl index bdb798f..f0ecfeb 100755 --- a/App/tools/getVersion.pl +++ b/App/tools/getVersion.pl @@ -267,7 +267,7 @@ sub parse_git_output { elsif ($line =~/([0-9a-fA-F]+)[ \t]+refs\/tags\//) { $remotetagcommit = $1 } - elsif ($line =~/\* [^ ]+ +([0-9a-fA-F]+) \[(.*)\/(.*)\]/) { + elsif ($line =~/\* [^ ]+ +([0-9a-fA-F]+) \[(.*)\/([^:]*).*\]/) { $commit = $1; $remote = $2; $branch = $3; @@ -324,6 +324,11 @@ eval { } else { say STDERR "commit undefined"; } + if (defined($branch)) { + say STDERR "branch = $branch"; + } else { + say STDERR "branch undefined"; + } } if (defined($remote) && defined($tag) && defined($commit)) { my $err = eval {