Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add merge_commit_sha to PullRequest model #1562

Merged
merged 2 commits into from
Mar 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Octokit/Models/Response/PullRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PullRequest(int number)
Number = number;
}

public PullRequest(long id, Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
public PullRequest(long id, Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
{
Id = id;
Url = url;
Expand All @@ -39,6 +39,7 @@ public PullRequest(long id, Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri
Assignees = assignees;
Mergeable = mergeable;
MergedBy = mergedBy;
MergeCommitSha = mergeCommitSha;
Comments = comments;
Commits = commits;
Additions = additions;
Expand Down Expand Up @@ -171,6 +172,15 @@ public bool Merged
/// </summary>
public User MergedBy { get; protected set; }

/// <summary>
/// The value of this field changes depending on the state of the pull request.
/// Not Merged - the hash of the test commit used to determine mergability.
/// Merged with merge commit - the hash of said merge commit.
/// Merged via squashing - the hash of the squashed commit added to the base branch.
/// Merged via rebase - the hash of the commit that the base branch was updated to.
/// </summary>
public string MergeCommitSha { get; protected set; }

/// <summary>
/// Total number of comments contained in the pull request.
/// </summary>
Expand Down