public GHContent getGHFile(String fileName, String sha) throws IOException {
return getGithubRepository().getFileContent(fileName, sha);
}
public String getShaForBranch(String branch) {
GitBranch gitBranch = new GitBranch(branch);
if (gitBranch.isPullRequest()) {
try {
return getGithubRepository().getPullRequest(gitBranch.pullRequestNumber()).getHead().getSha();
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
try {
GHRef ref = getRef("heads/" + gitBranch);
return ref.getObject().getSha();
} catch (IOException e) {
return gitBranch.toString();
}
}
}