mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-27 00:23:39 +00:00
Use GitReference across multiple types
This commit is contained in:
@@ -21,10 +21,10 @@ namespace Octokit.Tests.Integration
|
||||
|
||||
var repoName = Helper.MakeNameWithTimestamp("public-repo");
|
||||
this._commitsClient = this._gitHubClient.GitDatabase.Commit;
|
||||
this._repository = this._gitHubClient.Repository.Create(new NewRepository { Name = repoName }).Result;
|
||||
this._repository = this._gitHubClient.Repository.Create(new NewRepository { Name = repoName, AutoInit = true }).Result;
|
||||
}
|
||||
|
||||
[IntegrationTest(Skip = "Requires additional repository setup")]
|
||||
[IntegrationTest]
|
||||
public async Task CanCreateAndRetrieveCommit()
|
||||
{
|
||||
string owner = this._repository.Owner.Login;
|
||||
|
||||
@@ -2,20 +2,12 @@
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class Commit
|
||||
public class Commit : GitReference
|
||||
{
|
||||
public string Sha { get; set; }
|
||||
public string Url { get; set; }
|
||||
public string Message { get; set; }
|
||||
public UserAction Author { get; set; }
|
||||
public UserAction Committer { get; set; }
|
||||
public GitReference Tree { get; set; }
|
||||
public IEnumerable<GitReference> Parents { get; set; }
|
||||
}
|
||||
|
||||
public class GitReference
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public string Sha { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Octokit
|
||||
{
|
||||
public class GitReference
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public string Sha { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
namespace Octokit
|
||||
{
|
||||
public class GitTag
|
||||
public class GitTag : GitReference
|
||||
{
|
||||
public string Tag { get; set; }
|
||||
public string Sha { get; set; }
|
||||
public string Url { get; set; }
|
||||
public string Message { get; set; }
|
||||
public UserAction Tagger { get; set; }
|
||||
public TagObject Object { get; set; }
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
namespace Octokit
|
||||
{
|
||||
public class TagObject
|
||||
public class TagObject : GitReference
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods",
|
||||
Justification = "Name defined by web api and required for deserialisation")]
|
||||
public TaggedType Type { get; set; }
|
||||
public string Sha { get; set; }
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -18,5 +16,4 @@
|
||||
Blob,
|
||||
Tree
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,6 +77,7 @@
|
||||
<Compile Include="Models\Response\Activity.cs" />
|
||||
<Compile Include="Models\Response\CommitStatus.cs" />
|
||||
<Compile Include="Models\Response\EventInfo.cs" />
|
||||
<Compile Include="Models\Response\GitReference.cs" />
|
||||
<Compile Include="Models\Response\GitTag.cs" />
|
||||
<Compile Include="Models\Response\Issue.cs" />
|
||||
<Compile Include="Models\Request\IssueRequest.cs" />
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
<Compile Include="Models\Response\Commit.cs" />
|
||||
<Compile Include="Models\Response\CommitStatus.cs" />
|
||||
<Compile Include="Models\Response\EmailAddress.cs" />
|
||||
<Compile Include="Models\Response\GitReference.cs" />
|
||||
<Compile Include="Models\Response\GitTag.cs" />
|
||||
<Compile Include="Models\Response\EventInfo.cs" />
|
||||
<Compile Include="Models\Response\Issue.cs" />
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<Compile Include="Models\Response\Commit.cs" />
|
||||
<Compile Include="Models\Response\CommitStatus.cs" />
|
||||
<Compile Include="Models\Response\EventInfo.cs" />
|
||||
<Compile Include="Models\Response\GitReference.cs" />
|
||||
<Compile Include="Models\Response\Issue.cs" />
|
||||
<Compile Include="Models\Request\IssueRequest.cs" />
|
||||
<Compile Include="Models\Request\IssueUpdate.cs" />
|
||||
|
||||
Reference in New Issue
Block a user