Skip to content

Commit

Permalink
Merge pull request #1265 from kivancmuslu/master
Browse files Browse the repository at this point in the history
Ensure that Commit.Compare(..) sets MergeBaseCommit correctly.
  • Loading branch information
shiftkey committed Apr 11, 2016
2 parents 750aed6 + 5b72007 commit 1bfb7f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit 1bfb7f7

Please sign in to comment.