Skip to content

Commit

Permalink
[FIXED JENKINS-23393] Skip rebase on main branch
Browse files Browse the repository at this point in the history
Skip automatic rebase action when the project does not build a Subversion feature branch.
  • Loading branch information
hugueschabot committed Jul 15, 2014
1 parent 27a76b7 commit 5880b5a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/jenkins/plugins/svnmerge/RebaseBuilder.java
Expand Up @@ -35,7 +35,15 @@ public RebaseBuilder(String permalink, boolean stopBuildIfMergeFails) {

@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
RebaseAction rebaseAction = new RebaseAction(build.getProject());
AbstractProject<?,?> project = build.getProject();
FeatureBranchProperty property = project.getProperty(FeatureBranchProperty.class);

if (property == null) {
listener.getLogger().println("Project does not build a Subversion feature branch. Skip rebase action.");
return true;
}

RebaseAction rebaseAction = new RebaseAction(project);
long result = rebaseAction.perform(listener,new RebaseSetting(permalink));
return !stopBuildIfMergeFails || result >= 0;
}
Expand Down

0 comments on commit 5880b5a

Please sign in to comment.