Skip to content
Permalink
Browse files

Merge pull request #492 from abayer/jenkins-26100

[JENKINS-26100] Switch buildEnvVars and others to Run
  • Loading branch information
MarkEWaite committed Jun 21, 2017
2 parents 79c66eb + 133609e commit 907253d7149fdd53de3389528e163be8b5e298ef
Showing with 11 additions and 5 deletions.
  1. +1 −1 pom.xml
  2. +10 −4 src/main/java/hudson/plugins/git/GitSCM.java
@@ -220,7 +220,7 @@
<dependency><!-- we contribute AbstractBuildParameters for Git if it's available -->
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>parameterized-trigger</artifactId>
<version>2.9</version>
<version>2.33</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -1257,8 +1257,14 @@ private void computeChangeLog(GitClient git, Revision revToBuild, TaskListener l
}
}

public void buildEnvVars(AbstractBuild<?, ?> build, java.util.Map<String, String> env) {
super.buildEnvVars(build, env);
// TODO: 2.60+ Delete this override.
@Override
public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
buildEnvironment(build, env);
}

// TODO: 2.60+ Switch to @Override
public void buildEnvironment(Run<?, ?> build, java.util.Map<String, String> env) {
Revision rev = fixNull(getBuildData(build)).getLastBuiltRevision();
if (rev!=null) {
Branch branch = Iterables.getFirst(rev.getBranches(), null);
@@ -1321,7 +1327,7 @@ private String getBranchName(Branch branch)
return name;
}

private String getLastBuiltCommitOfBranch(AbstractBuild<?, ?> build, Branch branch) {
private String getLastBuiltCommitOfBranch(Run<?, ?> build, Branch branch) {
String prevCommit = null;
if (build.getPreviousBuiltBuild() != null) {
final Build lastBuildOfBranch = fixNull(getBuildData(build.getPreviousBuiltBuild())).getLastBuildOfBranch(branch.getName());
@@ -1335,7 +1341,7 @@ private String getLastBuiltCommitOfBranch(AbstractBuild<?, ?> build, Branch bran
return prevCommit;
}

private String getLastSuccessfulBuiltCommitOfBranch(AbstractBuild<?, ?> build, Branch branch) {
private String getLastSuccessfulBuiltCommitOfBranch(Run<?, ?> build, Branch branch) {
String prevCommit = null;
if (build.getPreviousSuccessfulBuild() != null) {
final Build lastSuccessfulBuildOfBranch = fixNull(getBuildData(build.getPreviousSuccessfulBuild())).getLastBuildOfBranch(branch.getName());

0 comments on commit 907253d

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