Skip to content

Commit 25c9874

Browse files
authored
BugFix: Update type PullRequest GetMergeCommit() to return commit Hash (#9)
* Add hash for merge_commit returned object to struct. * Update GetMergeCommit() to return commit Hash * Add PullRequestMergeCommit struct for merge_commit of PullRequest object. * Add changes after running gen-accessors
1 parent 52c1d14 commit 25c9874

File tree

2 files changed

+39
-26
lines changed

2 files changed

+39
-26
lines changed

bitbucket/bitbucket-accessors.go

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitbucket/pull_requests.go

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,32 @@ type PullRequests struct {
1717

1818
// PullRequest represents a Bitbucket pull request on a repository.
1919
type PullRequest struct {
20-
Body *PullRequestBody `json:"rendered,omitempty"`
21-
Type *string `json:"type,omitempty"`
22-
Description *string `json:"description,omitempty"`
23-
Links *PullRequestLinks `json:"links,omitempty"`
24-
Title *string `json:"title,omitempty"`
25-
CloseSourceBranch *bool `json:"close_source_branch,omitempty"`
26-
Reviewers []*User `json:"reviewers,omitempty"`
27-
ID *int64 `json:"id,omitempty"`
28-
Destination *PullRequestBranch `json:"destination,omitempty"`
29-
CreatedOn *time.Time `json:"created_on,omitempty"`
30-
Summary *Content `json:"summary,omitempty"`
31-
Source *PullRequestBranch `json:"source,omitempty"`
32-
CommentCount *int64 `json:"comment_count,omitempty"`
33-
State *string `json:"state,omitempty"`
34-
TaskCount *int64 `json:"task_count,omitempty"`
35-
Participants []*Participant `json:"participants,omitempty"`
36-
Reason *string `json:"reason,omitempty"`
37-
UpdatedOn *string `json:"updated_on,omitempty"`
38-
Author *User `json:"author,omitempty"`
39-
MergeCommit *string `json:"merge_commit,omitempty"`
40-
ClosedBy *User `json:"closed_by,omitempty"`
20+
Body *PullRequestBody `json:"rendered,omitempty"`
21+
Type *string `json:"type,omitempty"`
22+
Description *string `json:"description,omitempty"`
23+
Links *PullRequestLinks `json:"links,omitempty"`
24+
Title *string `json:"title,omitempty"`
25+
CloseSourceBranch *bool `json:"close_source_branch,omitempty"`
26+
Reviewers []*User `json:"reviewers,omitempty"`
27+
ID *int64 `json:"id,omitempty"`
28+
Destination *PullRequestBranch `json:"destination,omitempty"`
29+
CreatedOn *time.Time `json:"created_on,omitempty"`
30+
Summary *Content `json:"summary,omitempty"`
31+
Source *PullRequestBranch `json:"source,omitempty"`
32+
CommentCount *int64 `json:"comment_count,omitempty"`
33+
State *string `json:"state,omitempty"`
34+
TaskCount *int64 `json:"task_count,omitempty"`
35+
Participants []*Participant `json:"participants,omitempty"`
36+
Reason *string `json:"reason,omitempty"`
37+
UpdatedOn *string `json:"updated_on,omitempty"`
38+
Author *User `json:"author,omitempty"`
39+
MergeCommit *PullRequestMergeCommit `json:"merge_commit,omitempty"`
40+
ClosedBy *User `json:"closed_by,omitempty"`
41+
}
42+
43+
// PullRequestMergeCommit represents the "merge_commit" object in a Bitbucket pull request.
44+
type PullRequestMergeCommit struct {
45+
Hash *string `json:"hash,omitempty"`
4146
}
4247

4348
// PullRequestLinks represents the "links" object in a Bitbucket pull request.

0 commit comments

Comments
 (0)