aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
487 stars 180 forks source link

Issue with release-start goal creating multiple release branches #399

Open jelingi opened 6 months ago

jelingi commented 6 months ago

When executing the release-start goal of the Gitflow Maven Plugin in Jenkins, it appears that the remote check is not executed correctly. Even if there is already an existing release branch, running the release-start goal again results in the creation of a new release branch, instead of thowing the error "Release branch already exists. Cannot start release."

GitFlowReleaseStartMojo.java:153-157 final String releaseBranch = gitFindBranches(gitFlowConfig.getReleaseBranchPrefix(), true); if (StringUtils.isNotBlank(releaseBranch)) { throw new MojoFailureException("Release branch already exists. Cannot start release."); }

Plugin Version: 1.20 Jenkins Log:

If I execute the command in the Pipeline : sh "git for-each-ref '--format=%(refname:short)' refs/heads/release/** refs/remotes/origin/release/**"

All the refs are shown correctly:

Do you have any ideas why the check for existing remote branches isnt working correclty in the plugin ?

Kind regards Jelin

jelingi commented 6 months ago

image