Skip to content

Commit

Permalink
[JENKINS-23641] - Annotate BuildData::getLastBuiltRevision()
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev authored and MarkEWaite committed Oct 12, 2014
1 parent 0c89783 commit d15e410
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 d15e410

Please sign in to comment.