Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
git diff models
  • Loading branch information
kiliit committed Sep 24, 2015
commit 7cc97a800b477d8f53d971c22ef21365cf97b5cd
30 changes: 30 additions & 0 deletions repo_commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,36 @@ type Commit struct {
CommitMessage string `json:"commit_message"`
}

type DiffLine struct {
LeftIdx int `json:"left_idx"`
RightIdx int `json:"right_idx"`
Type int `json:"type"`
Content string `json:"content"`
}

type DiffSection struct {
Name string `json:"name"`
Lines []*DiffLine `json:"lines"`
}

type DiffFile struct {
Name string `json:"name"`
Index int `json:"index"`
Addition int `json:"addition"`
Deletion int `json:"deletion"`
Type int `json:"type"`
IsCreated bool `json:"created"`
IsDeleted bool `json:"deleted"`
IsBin bool `json:"bin"`
Sections []*DiffSection `json:"sections"`
}

type Diff struct {
TotalAddition int `json:"total_addition"`
TotalDeletion int `json:"total_deletion"`
Files []*DiffFile `json:"files"`
}

func (c *Client) CommitById(user, repo, id string) (*Commit, error) {
commit := new(Commit)
return commit, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/commits/%s", user, repo, id), nil, nil, commit)
Expand Down