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

Ensure that Commit.Compare(..) sets MergeBaseCommit correctly. #1265

Merged
merged 1 commit into from
Apr 11, 2016
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public TestsWithExistingRepositories()
_fixture = client.Repository.Commit;
}

[IntegrationTest]
public async Task CanGetMergeBaseCommit()
{
var compareResult = await _fixture.Compare("octokit", "octokit.net", "65a22f4d2cff94a286ac3e96440c810c5509196f", "65a22f4d2cff94a286ac3e96440c810c5509196f");
Assert.NotNull(compareResult.MergeBaseCommit);
}

[IntegrationTest]
public async Task CanGetCommit()
{
Expand Down
9 changes: 6 additions & 3 deletions Octokit/Models/Response/CompareResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;

Expand All @@ -9,15 +10,15 @@ public class CompareResult
{
public CompareResult() { }

public CompareResult(string url, string htmlUrl, string permalinkUrl, string diffUrl, string patchUrl, GitHubCommit baseCommit, GitHubCommit mergedBaseCommit, string status, int aheadBy, int behindBy, int totalCommits, IReadOnlyList<GitHubCommit> commits, IReadOnlyList<GitHubCommitFile> files)
public CompareResult(string url, string htmlUrl, string permalinkUrl, string diffUrl, string patchUrl, GitHubCommit baseCommit, GitHubCommit mergeBaseCommit, string status, int aheadBy, int behindBy, int totalCommits, IReadOnlyList<GitHubCommit> commits, IReadOnlyList<GitHubCommitFile> files)
{
Url = url;
HtmlUrl = htmlUrl;
PermalinkUrl = permalinkUrl;
DiffUrl = diffUrl;
PatchUrl = patchUrl;
BaseCommit = baseCommit;
MergedBaseCommit = mergedBaseCommit;
MergeBaseCommit = mergeBaseCommit;
Status = status;
AheadBy = aheadBy;
BehindBy = behindBy;
Expand All @@ -32,7 +33,9 @@ public CompareResult(string url, string htmlUrl, string permalinkUrl, string dif
public string DiffUrl { get; protected set; }
public string PatchUrl { get; protected set; }
public GitHubCommit BaseCommit { get; protected set; }
[Obsolete("This property is obsolete. Use MergeBaseCommit instead.", false)]
public GitHubCommit MergedBaseCommit { get; protected set; }
public GitHubCommit MergeBaseCommit { get; protected set; }
public string Status { get; protected set; }
public int AheadBy { get; protected set; }
public int BehindBy { get; protected set; }
Expand Down