Skip to content

Commit

Permalink
Merge pull request #259 from oleg-nenashev/JENKINS-23641
Browse files Browse the repository at this point in the history
[JENKINS-23641] - Annotate BuildData::getLastBuiltRevision()
  • Loading branch information
MarkEWaite committed Oct 12, 2014
2 parents e43d17f + d0180c4 commit e0760d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/hudson/plugins/git/util/BuildData.java
@@ -1,5 +1,6 @@
package hudson.plugins.git.util;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import hudson.Functions;
import hudson.model.AbstractBuild;
import hudson.model.Action;
Expand Down Expand Up @@ -140,8 +141,13 @@ public Build getLastBuildOfBranch(String branch) {
return buildsByBranchName.get(branch);
}

/**
* Gets revision of the previous build.
* @return revision of the last build.
* May be null will be returned if nothing has been checked out (e.g. due to wrong repository or branch)
*/
@Exported
public Revision getLastBuiltRevision() {
public @CheckForNull Revision getLastBuiltRevision() {
return lastBuild==null?null:lastBuild.revision;
}

Expand Down

0 comments on commit e0760d6

Please sign in to comment.