From 64aa9649c9621ffc76e41c3e62c2cd8939eb1078 Mon Sep 17 00:00:00 2001 From: Aleksandr Mashchenko Date: Thu, 2 Jun 2022 23:16:04 +0300 Subject: [PATCH] Fix remote branch fetching and comparing --- .../amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java index ca60a98d..39dc022b 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java @@ -990,9 +990,9 @@ protected void gitBranchDeleteForce(final String branchName) * If command line execution fails. */ protected void gitFetchRemoteAndCompareCreate(final String branchName) throws MojoFailureException, CommandLineException { - final boolean fetchOk = gitFetchRemote(); + final boolean remoteBranchExists = StringUtils.isNotBlank(gitFetchAndFindRemoteBranches(branchName, true)); if (gitCheckBranchExists(branchName)) { - if (fetchOk) { + if (remoteBranchExists) { getLog().info( "Comparing local branch '" + branchName + "' with remote '" + gitFlowConfig.getOrigin() + "/" + branchName + "'."); String revlistout = executeGitCommandReturn("rev-list", "--left-right", "--count",