Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GET https://api.github.com/repos/:owner/:repo/git/refs/heads/:branch
- https://api.github.com/repos/izuzak/pmrpc/git/refs/heads/master
- {
- "ref": "refs/heads/master",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/refs/heads/master",
- "object": {
- "sha": "fd6973f430a3367ad718ff049f1b075843913d6f",
- "type": "commit",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/commits/fd6973f430a3367ad718ff049f1b075843913d6f"
- }
- }
- GET https://api.github.com/repos/izuzak/pmrpc/git/commits/fd6973f430a3367ad718ff049f1b075843913d6f
- {
- "sha": "fd6973f430a3367ad718ff049f1b075843913d6f",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/commits/fd6973f430a3367ad718ff049f1b075843913d6f",
- "html_url": "https://github.com/izuzak/pmrpc/commits/fd6973f430a3367ad718ff049f1b075843913d6f",
- "author": {
- "name": "Ivan Zuzak",
- "email": "izuzak@gmail.com",
- "date": "2013-04-09T08:55:45Z"
- },
- "committer": {
- "name": "Ivan Zuzak",
- "email": "izuzak@gmail.com",
- "date": "2013-04-09T08:55:45Z"
- },
- "tree": {
- "sha": "f5f5de80f67dd794ffbd4abb855fb7d1a573660e",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/trees/f5f5de80f67dd794ffbd4abb855fb7d1a573660e"
- },
- "message": "fix typos",
- "parents": [
- {
- "sha": "d3617ae56dda793131e743b2ff394984bbab6ca3",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/commits/d3617ae56dda793131e743b2ff394984bbab6ca3",
- "html_url": "https://github.com/izuzak/pmrpc/commits/d3617ae56dda793131e743b2ff394984bbab6ca3"
- }
- ]
- }
- GET https://api.github.com/repos/izuzak/pmrpc/git/trees/f5f5de80f67dd794ffbd4abb855fb7d1a573660e
- {
- "sha": "f5f5de80f67dd794ffbd4abb855fb7d1a573660e",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/trees/f5f5de80f67dd794ffbd4abb855fb7d1a573660e",
- "tree": [
- {
- "mode": "100644",
- "type": "blob",
- "sha": "726f21a4adec8c24c2fab6cf5b455d094a8b21bf",
- "path": "LICENSE.markdown",
- "size": 568,
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/blobs/726f21a4adec8c24c2fab6cf5b455d094a8b21bf"
- },
- {
- "mode": "100644",
- "type": "blob",
- "sha": "eb94760b81441b34a73d1b085d9f153ae48b0e63",
- "path": "README.markdown",
- "size": 5772,
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/blobs/eb94760b81441b34a73d1b085d9f153ae48b0e63"
- },
- {
- "mode": "040000",
- "type": "tree",
- "sha": "2e72b217b8644ce6874cda03387a7ab2d8eee55e",
- "path": "examples",
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/trees/2e72b217b8644ce6874cda03387a7ab2d8eee55e"
- },
- {
- "mode": "100644",
- "type": "blob",
- "sha": "64b0dbe4981759c0f9640c8e882c97c7324fc798",
- "path": "pmrpc.js",
- "size": 24546,
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/blobs/64b0dbe4981759c0f9640c8e882c97c7324fc798"
- }
- ]
- }
- GET https://api.github.com/repos/izuzak/pmrpc/git/trees/2e72b217b8644ce6874cda03387a7ab2d8eee55e
- GET https://api.github.com/repos/:user/:repo/commits?path=FILE_OR_FOLDER_PATH
- GET https://api.github.com/repos/izuzak/pmrpc/commits?path=examples
- [
- {
- "sha": "3437f015257683a86e3b973b3279754df9ac2b24",
- "commit": {
- "author": { ... },
- "committer": { ... },
- "message": "change mode",
- "tree": { ... },
- "url": "https://api.github.com/repos/izuzak/pmrpc/git/commits/3437f015257683a86e3b973b3279754df9ac2b24",
- "comment_count": 0
- },
- ...
- },
- {
- ...
- }
- ]
- func GetLatestCommit(owner, repo string, sgc *github.Client) (string, error) {
- commits, res, err := sgc.Repositories.ListCommits(owner, repo, &github.CommitsListOptions{})
- if err != nil {
- log.Printf("err: %s res: %s", err, res)
- return "", err
- }
- log.Printf("last commit: %s", *commits[0].SHA)
- return *commits[0].SHA, nil
- }
- <a href="/luckydonald/JavaPipBoyServer/blob/a6f4038336ff41463ad527b4ff4fda45642ebc6d/PROTOCOL.md" class="d-none js-permalink-shortcut" data-hotkey="y">Permalink</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement