Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch git 2.2.0 #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/main/java/hudson/plugins/git/GitSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public boolean checkout(final AbstractBuild build, Launcher launcher,
}

List<RemoteConfig> repos = entry.getValue();
final Revision revToBuild = gerRevisionToBuild(listener, workingDirectory, gitExe, buildData, environment,
final Revision revToBuild = getRevisionToBuild(listener, workingDirectory, gitExe, buildData, environment,
singleBranch, repos,
parentLastBuiltRev, rpa);

Expand Down Expand Up @@ -647,7 +647,6 @@ public boolean checkout(final AbstractBuild build, Launcher launcher,
buildConfig = getBuildConfig(listener, workingDirectory, buildNumber, gitExe, buildData, environment,
paramLocalBranch, repos, revToBuild, internalTagName, internalTagComment);


build.addAction(buildConfig.getBuildData());

result = result && changeLogResult(buildConfig.getChangeLog(), changelogFile);
Expand Down Expand Up @@ -838,7 +837,7 @@ public BuildConfig invoke(File localWorkspace, VirtualChannel channel)
});
}

private Revision gerRevisionToBuild(final BuildListener listener, FilePath workingDirectory, final String gitExe,
private Revision getRevisionToBuild(final BuildListener listener, FilePath workingDirectory, final String gitExe,
final BuildData buildData, final EnvVars environment, final String singleBranch,
final List<RemoteConfig> paramRepos, final Revision parentLastBuiltRev,
final RevisionParameterAction rpa) throws IOException, InterruptedException {
Expand Down Expand Up @@ -1462,18 +1461,16 @@ private RemoteConfig newRemoteConfig(String name, String refUrl, RefSpec refSpec
}
}

private boolean changeLogResult(String changeLog, File changelogFile) throws IOException {
if (changeLog == null) {
return false;
} else {
changelogFile.delete();
private boolean changeLogResult(String changeLog, File changeLogFile) throws IOException {
changeLogFile.delete();

FileOutputStream fos = new FileOutputStream(changelogFile);
if (changeLog != null) {
FileOutputStream fos = new FileOutputStream(changeLogFile);
fos.write(changeLog.getBytes());
fos.close();
// Write to file
return true;
}

return true;
}

private Pattern[] getExcludedRegionsPatterns() {
Expand Down