Skip to content

Commit

Permalink
Replace SignatureResponse and CommitEntity with Committer
Browse files Browse the repository at this point in the history
A recent PR added CommitEntity but we already had
SignatureResponse expressly for this purpose.

So this commit renames SignatureResponse to Committer
and removes CommitEntity and replaces it with Committer.
  • Loading branch information
haacked committed Sep 28, 2015
1 parent 1cea52e commit b2d6e15
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 105 deletions.
4 changes: 1 addition & 3 deletions Octokit.Tests/Clients/TagsClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NSubstitute;
using Octokit;
using Octokit.Internal;
using Octokit.Tests.Helpers;
using Xunit;

public class TagsClientTests
Expand Down Expand Up @@ -83,7 +81,7 @@ public void PerformsNewTagSerialization()
Tag = "tag-name",
Object = "tag-object",
Type = TaggedType.Tree,
Tagger = new SignatureResponse("tagger-name", "tagger-email", DateTimeOffset.Parse("2013-09-03T13:42:52Z"))
Tagger = new Committer("tagger-name", "tagger-email", DateTimeOffset.Parse("2013-09-03T13:42:52Z"))
};

var json = new SimpleJsonSerializer().Serialize(tag);
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Request/CreateFileRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ protected ContentRequest(string message)
/// <summary>
/// Specifies the committer to use for the commit. This is optional.
/// </summary>
public SignatureResponse Committer { get; set; }
public Committer Committer { get; set; }

/// <summary>
/// Specifies the author to use for the commit. This is optional.
/// </summary>
public SignatureResponse Author { get; set; }
public Committer Author { get; set; }
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Request/NewCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public NewCommit(string message, string tree, string parent)
/// <value>
/// The author.
/// </value>
public SignatureResponse Author { get; set; }
public Committer Author { get; set; }

/// <summary>
/// Gets or sets the person who applied the commit. If omitted, this will be filled in with the
Expand All @@ -95,7 +95,7 @@ public NewCommit(string message, string tree, string parent)
/// <value>
/// The committer.
/// </value>
public SignatureResponse Committer { get; set; }
public Committer Committer { get; set; }

internal string DebuggerDisplay
{
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Models/Request/NewTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class NewTag
/// <value>
/// The tagger.
/// </value>
public SignatureResponse Tagger { get; set; }
public Committer Tagger { get; set; }

internal string DebuggerDisplay
{
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Models/Response/Commit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Commit : GitReference
{
public Commit() { }

public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, SignatureResponse author, SignatureResponse committer, GitReference tree, IEnumerable<GitReference> parents, int commentCount)
public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable<GitReference> parents, int commentCount)
: base(url, label, @ref, sha, user, repository)
{
Ensure.ArgumentNotNull(parents, "parents");
Expand All @@ -25,9 +25,9 @@ public Commit(string url, string label, string @ref, string sha, User user, Repo

public string Message { get; protected set; }

public SignatureResponse Author { get; protected set; }
public Committer Author { get; protected set; }

public SignatureResponse Committer { get; protected set; }
public Committer Committer { get; protected set; }

public GitReference Tree { get; protected set; }

Expand Down
36 changes: 0 additions & 36 deletions Octokit/Models/Response/CommitEntity.cs

This file was deleted.

61 changes: 61 additions & 0 deletions Octokit/Models/Response/Committer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System;
using System.Diagnostics;
using System.Globalization;

namespace Octokit
{
/// <summary>
/// Represents the author or committer to a Git commit. This is the information stored in Git and should not be
/// confused with GitHub account information.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Committer
{
/// <summary>
/// Initializes a new instance of the <see cref="Committer"/> class.
/// </summary>
public Committer() { }

/// <summary>
/// Initializes a new instance of the <see cref="Committer"/> class.
/// </summary>
/// <param name="name">The full name of the author or committer.</param>
/// <param name="email">The email.</param>
/// <param name="date">The date.</param>
public Committer(string name, string email, DateTimeOffset date)
{
Name = name;
Email = email;
Date = date;
}

/// <summary>
/// Gets the name of the author or committer.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; protected set; }

/// <summary>
/// Gets the email of the author or committer.
/// </summary>
/// <value>
/// The email.
/// </value>
public string Email { get; protected set; }

/// <summary>
/// Gets the date of the author or contributor's contributions.
/// </summary>
/// <value>
/// The date.
/// </value>
public DateTimeOffset Date { get; protected set; }

internal string DebuggerDisplay
{
get { return String.Format(CultureInfo.InvariantCulture, "Name: {0} Email: {1} Date: {2}", Name, Email, Date); }
}
}
}
6 changes: 3 additions & 3 deletions Octokit/Models/Response/GitHubCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class GitHubCommit : GitReference
{
public GitHubCommit() { }

public GitHubCommit(string url, string label, string @ref, string sha, User user, Repository repository, CommitEntity author, string commentsUrl, Commit commit, CommitEntity committer, string htmlUrl, GitHubCommitStats stats, IReadOnlyList<GitReference> parents, IReadOnlyList<GitHubCommitFile> files)
public GitHubCommit(string url, string label, string @ref, string sha, User user, Repository repository, Author author, string commentsUrl, Commit commit, Author committer, string htmlUrl, GitHubCommitStats stats, IReadOnlyList<GitReference> parents, IReadOnlyList<GitHubCommitFile> files)
: base(url, label, @ref, sha, user, repository)
{
Author = author;
Expand All @@ -24,13 +24,13 @@ public GitHubCommit(string url, string label, string @ref, string sha, User user
Files = files;
}

public CommitEntity Author { get; protected set; }
public Author Author { get; protected set; }

public string CommentsUrl { get; protected set; }

public Commit Commit { get; protected set; }

public CommitEntity Committer { get; protected set; }
public Author Committer { get; protected set; }

public string HtmlUrl { get; protected set; }

Expand Down
4 changes: 2 additions & 2 deletions Octokit/Models/Response/GitTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class GitTag : GitReference
{
public GitTag() { }

public GitTag(string url, string label, string @ref, string sha, User user, Repository repository, string tag, string message, SignatureResponse tagger, TagObject objectVar)
public GitTag(string url, string label, string @ref, string sha, User user, Repository repository, string tag, string message, Committer tagger, TagObject objectVar)
: base(url, label, @ref, sha, user, repository)
{
Tag = tag;
Expand All @@ -20,7 +20,7 @@ public GitTag(string url, string label, string @ref, string sha, User user, Repo

public string Message { get; protected set; }

public SignatureResponse Tagger { get; protected set; }
public Committer Tagger { get; protected set; }

public TagObject Object { get; protected set; }
}
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Models/Response/PullRequestCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PullRequestCommit
{
public PullRequestCommit() { }

public PullRequestCommit(SignatureResponse author, Uri commentsUrl, Commit commit, SignatureResponse committer, Uri htmlUrl, IEnumerable<GitReference> parents, string sha, Uri url)
public PullRequestCommit(Committer author, Uri commentsUrl, Commit commit, Committer committer, Uri htmlUrl, IEnumerable<GitReference> parents, string sha, Uri url)
{
Ensure.ArgumentNotNull(parents, "parents");

Expand All @@ -26,13 +26,13 @@ public PullRequestCommit(SignatureResponse author, Uri commentsUrl, Commit commi
Url = url;
}

public SignatureResponse Author { get; protected set; }
public Committer Author { get; protected set; }

public Uri CommentsUrl { get; protected set; }

public Commit Commit { get; protected set; }

public SignatureResponse Committer { get; protected set; }
public Committer Committer { get; protected set; }

public Uri HtmlUrl { get; protected set; }

Expand Down
30 changes: 0 additions & 30 deletions Octokit/Models/Response/SignatureResponse.cs

This file was deleted.

5 changes: 2 additions & 3 deletions Octokit/Octokit-Mono.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
<Compile Include="Models\Response\RepositoryContent.cs" />
<Compile Include="Models\Response\RepositoryContentChangeSet.cs" />
<Compile Include="Models\Response\CommitContent.cs" />
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Models\Response\Committer.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Helpers\ApiUrls.Authorizations.cs" />
<Compile Include="Models\Response\ApplicationAuthorization.cs" />
Expand All @@ -403,7 +403,6 @@
<Compile Include="Http\RequestBody.cs" />
<Compile Include="Http\IApiInfoProvider.cs" />
<Compile Include="Models\Response\Meta.cs" />
<Compile Include="Models\Response\CommitEntity.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
5 changes: 2 additions & 3 deletions Octokit/Octokit-MonoAndroid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
<Compile Include="Models\Response\RepositoryContent.cs" />
<Compile Include="Models\Response\RepositoryContentChangeSet.cs" />
<Compile Include="Models\Response\CommitContent.cs" />
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Models\Response\Committer.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Helpers\ApiUrls.Authorizations.cs" />
<Compile Include="Models\Response\ApplicationAuthorization.cs" />
Expand All @@ -411,7 +411,6 @@
<Compile Include="Http\RequestBody.cs" />
<Compile Include="Http\IApiInfoProvider.cs" />
<Compile Include="Models\Response\Meta.cs" />
<Compile Include="Models\Response\CommitEntity.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
</Project>
</Project>
5 changes: 2 additions & 3 deletions Octokit/Octokit-Monotouch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
<Compile Include="Models\Response\RepositoryContent.cs" />
<Compile Include="Models\Response\RepositoryContentChangeSet.cs" />
<Compile Include="Models\Response\CommitContent.cs" />
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Models\Response\Committer.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Helpers\ApiUrls.Authorizations.cs" />
<Compile Include="Models\Response\ApplicationAuthorization.cs" />
Expand All @@ -407,8 +407,7 @@
<Compile Include="Http\RequestBody.cs" />
<Compile Include="Http\IApiInfoProvider.cs" />
<Compile Include="Models\Response\Meta.cs" />
<Compile Include="Models\Response\CommitEntity.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
7 changes: 3 additions & 4 deletions Octokit/Octokit-Portable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
<Compile Include="Models\Response\RepositoryContent.cs" />
<Compile Include="Models\Response\RepositoryContentChangeSet.cs" />
<Compile Include="Models\Response\CommitContent.cs" />
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Models\Response\Committer.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Helpers\ApiUrls.Authorizations.cs" />
<Compile Include="Models\Response\ApplicationAuthorization.cs" />
Expand All @@ -400,7 +400,6 @@
<Compile Include="Http\RequestBody.cs" />
<Compile Include="Http\IApiInfoProvider.cs" />
<Compile Include="Models\Response\Meta.cs" />
<Compile Include="Models\Response\CommitEntity.cs" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
Expand All @@ -424,11 +423,11 @@
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
5 changes: 2 additions & 3 deletions Octokit/Octokit-netcore45.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -379,7 +379,7 @@
<Compile Include="Models\Response\RepositoryContent.cs" />
<Compile Include="Models\Response\RepositoryContentChangeSet.cs" />
<Compile Include="Models\Response\CommitContent.cs" />
<Compile Include="Models\Response\SignatureResponse.cs" />
<Compile Include="Models\Response\Committer.cs" />
<Compile Include="Helpers\PropertyOrField.cs" />
<Compile Include="Helpers\ApiUrls.Authorizations.cs" />
<Compile Include="Models\Response\ApplicationAuthorization.cs" />
Expand All @@ -404,7 +404,6 @@
<Compile Include="Http\RequestBody.cs" />
<Compile Include="Http\IApiInfoProvider.cs" />
<Compile Include="Models\Response\Meta.cs" />
<Compile Include="Models\Response\CommitEntity.cs" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
Expand Down
Loading

0 comments on commit b2d6e15

Please sign in to comment.