Skip to content
Permalink
Browse files

fixed JENKINS-24285

  • Loading branch information
Andrius Ordojan
Andrius Ordojan committed Aug 15, 2014
1 parent 7d0bf3c commit dd8ae5cbff41ba83a6404c62478805397b8e2e38
@@ -44,6 +44,7 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener
ByteArrayOutputStream out = new ByteArrayOutputStream();
BuildData gitBuildData = build.getAction(BuildData.class);
Branch gitDataBranch = gitBuildData.lastBuild.revision.getBranches().iterator().next();
GitClient client;

String integrationSHA = "Not specified";
try {
@@ -53,7 +54,7 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener
listener.getLogger().println( String.format( "Preparing to merge changes in commit %s to integration branch %s(%s)", gitDataBranch.getSHA1String(), bridge.getBranch(), integrationSHA) );
boolean found = false;
try {
GitClient client = Git.with(listener, build.getEnvironment(listener)).in(build.getWorkspace()).getClient();
client = Git.with(listener, build.getEnvironment(listener)).in(build.getWorkspace()).getClient();

for(Branch b : client.getRemoteBranches()) {
if(b.getName().equals(gitDataBranch.getName())) {
@@ -76,6 +77,8 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener
}

try {
String commitMessage = client.showRevision(gitDataBranch.getSHA1()).get(5).trim();

String[] split = gitDataBranch.getName().split("/");
String branchNameWithNoRemote = "";
for (int i = 1; i < split.length; i++) {
@@ -85,7 +88,9 @@ public void integrate(AbstractBuild<?,?> build, Launcher launcher, BuildListener


exitCode = gitbridge.git(build, launcher, listener, out, "merge", "--squash", gitDataBranch.getName());
exitCodeCommit = gitbridge.git(build, launcher, listener, out, "commit", "-m", String.format("Integrated %s", branchNameWithNoRemote));
exitCodeCommit = gitbridge.git(build, launcher, listener, out, "commit", "-m", String.format("%s [%s]",
commitMessage,
branchNameWithNoRemote));
} catch (Exception ex) { /*Handled below */ }

if (exitCode != 0) {

0 comments on commit dd8ae5c

Please sign in to comment.
You can’t perform that action at this time.