Skip to content

Commit

Permalink
Revert "Off by one in gh-133"
Browse files Browse the repository at this point in the history
This reverts commit 894792a.
  • Loading branch information
MadsNielsen committed Aug 16, 2018
1 parent 894792a commit 4ae43f6
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ public static void pushToIntegrationBranchGit(Run<?, ?> run, TaskListener listen
}
}

public static void pushToBranch(TaskListener listener, GitClient client, String sourceLocalBranch, String targetRemoteBranch, String expandedRepo) throws PushFailedException {
pushToBranch(listener, client, sourceLocalBranch, targetRemoteBranch, expandedRepo, 0);
}

public static void pushToBranch(TaskListener listener, GitClient client, String sourceLocalBranch, String targetRemoteBranch, String expandedRepo, int retries) throws PushFailedException {
try {
LOGGER.log(Level.INFO, "Pushing changes from local branch: " + sourceLocalBranch + " to remote branch: " + targetRemoteBranch);
Expand All @@ -93,7 +89,7 @@ public static void pushToBranch(TaskListener listener, GitClient client, String
} catch (GitException gex) {
final Pattern nonFastForward = Pattern.compile(".*[rejected].*\\(non-fast-forward\\).*", Pattern.DOTALL);
//Something is wrong on the remote and it's not a fast forward issue...try again
if (gex.getMessage() != null && !nonFastForward.matcher(gex.getMessage()).matches() && retries > 0) {
if (gex.getMessage() != null && !nonFastForward.matcher(gex.getMessage()).matches() && retries >= 0) {
LOGGER.log(Level.WARNING, LOG_PREFIX + "Failed to push...retrying in 5 seconds");
listener.getLogger().println(LOG_PREFIX + "Failed to push...retrying in 5 seconds");
try {
Expand Down

0 comments on commit 4ae43f6

Please sign in to comment.