github :: GithubAPI :: get_commit
sha
.Returns null
if the commit cannot be found.
var api = new GithubAPI(get_github_oauth)
var repo = api.get_repo("nitlang/nit")
assert repo != null
var commit = api.get_commit(repo, "64ce1f")
assert commit isa Commit
# Get the Github commit with `sha`.
#
# Returns `null` if the commit cannot be found.
#
# ~~~nitish
# var api = new GithubAPI(get_github_oauth)
# var repo = api.get_repo("nitlang/nit")
# assert repo != null
# var commit = api.get_commit(repo, "64ce1f")
# assert commit isa Commit
# ~~~
fun get_commit(repo_slug: String, sha: String): nullable Commit do
return get("/repos/{repo_slug}/commits/{sha}").as(nullable Commit)
end
lib/github/api.nit:291,2--304,4