Skip to content
Permalink
Browse files

Merge pull request #530 from MarkEWaite/remove-printCommitMessageToLog

[JENKINS-45729] - Move print commit message after checkout
  • Loading branch information
MarkEWaite committed Sep 29, 2017
2 parents a6ddae8 + c1ac701 commit 34f047f644bb32db8359cc71715590d1902db701
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/main/java/hudson/plugins/git/GitSCM.java
@@ -1156,8 +1156,6 @@ public void checkout(Run<?, ?> build, Launcher launcher, FilePath workspace, Tas

listener.getLogger().println("Checking out " + revToBuild.revision);

printCommitMessageToLog(listener, git, revToBuild);

CheckoutCommand checkoutCommand = git.checkout().branch(localBranchName).ref(revToBuild.revision.getSha1String()).deleteBranchIfExist(true);
for (GitSCMExtension ext : this.getExtensions()) {
ext.decorateCheckoutCommand(this, build, git, listener, checkoutCommand);
@@ -1170,6 +1168,13 @@ public void checkout(Run<?, ?> build, Launcher launcher, FilePath workspace, Tas
throw new IOException("Could not checkout " + revToBuild.revision.getSha1String(), e);
}

// Needs to be after the checkout so that revToBuild is in the workspace
try {
printCommitMessageToLog(listener, git, revToBuild);
} catch (GitException ge) {
listener.getLogger().println("Exception logging commit message for " + revToBuild + ": " + ge.getMessage());
}

// Don't add the tag and changelog if we've already processed this BuildData before.
if (!buildDataAlreadyPresent) {
if (build.getActions(AbstractScmTagAction.class).isEmpty()) {

0 comments on commit 34f047f

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