Skip to content

Commit

Permalink
@jglick's comment has been addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Recena committed Oct 30, 2015
1 parent 689fa61 commit a49806f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import jenkins.scm.api.SCMSourceCriteria;
import org.eclipse.jgit.transport.RefSpec;
import org.kohsuke.github.GHBranch;
import org.kohsuke.github.GHRef;
import org.kohsuke.github.GHRepository;
import org.kohsuke.stapler.DataBoundConstructor;

Expand Down Expand Up @@ -88,8 +89,9 @@ protected List<RefSpec> getRefSpecs() {
listener.getLogger().format(" %d branches were processed%n", branches);
}

@Override protected SCMRevision doRetrieve(SCMHead head, TaskListener listener, GHRepository repo) {
return new SCMRevisionImpl(head, "heads/" + head.getName());
@Override protected SCMRevision doRetrieve(SCMHead head, TaskListener listener, GHRepository repo) throws IOException {
GHRef ref = repo.getRef("heads/" + head.getName());
return new SCMRevisionImpl(head, ref.getObject().getSha());
}

@Extension public static class DescriptorImpl extends AbstractGitHubSCMSourceDescriptor {
Expand Down

0 comments on commit a49806f

Please sign in to comment.