Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Conversation

@danports
Copy link
Contributor

Closes #30.

Adds a new Commit class and a Tree:getCommit method.

Technically, a Git commit owns/references a Git tree rather than vice-versa, but the GitHub API doesn't quite work that way: you can GET /repos/:owner/:repo/git/trees/:commit_ish, but strangely, commit-ishes don't work with the commits API; GET /repos/:owner/:repo/git/commits/master fails with a 404. Plus restructuring the Lua API to have Commit own Tree would probably have broken backwards compatibility in a number of ways, so I just made the minimal number of changes to make this feature work.

This could be merged now, but Tree:getCommit will require corrections if merged after #27, because self.sha may still be set to a commit-ish rather than a SHA before Tree:getContents is called.

Going to test this out a bit before I mark it ready for review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for GitHub commits

1 participant