diff --git a/Octokit.Tests/Clients/TagsClientTests.cs b/Octokit.Tests/Clients/TagsClientTests.cs index 7a8ce5f34c..43724514d5 100644 --- a/Octokit.Tests/Clients/TagsClientTests.cs +++ b/Octokit.Tests/Clients/TagsClientTests.cs @@ -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 @@ -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); diff --git a/Octokit/Models/Request/CreateFileRequest.cs b/Octokit/Models/Request/CreateFileRequest.cs index 116d085358..f5a98d398d 100644 --- a/Octokit/Models/Request/CreateFileRequest.cs +++ b/Octokit/Models/Request/CreateFileRequest.cs @@ -34,12 +34,12 @@ protected ContentRequest(string message) /// /// Specifies the committer to use for the commit. This is optional. /// - public SignatureResponse Committer { get; set; } + public Committer Committer { get; set; } /// /// Specifies the author to use for the commit. This is optional. /// - public SignatureResponse Author { get; set; } + public Committer Author { get; set; } } /// diff --git a/Octokit/Models/Request/NewCommit.cs b/Octokit/Models/Request/NewCommit.cs index b4a66858fa..937eb2a4a5 100644 --- a/Octokit/Models/Request/NewCommit.cs +++ b/Octokit/Models/Request/NewCommit.cs @@ -86,7 +86,7 @@ public NewCommit(string message, string tree, string parent) /// /// The author. /// - public SignatureResponse Author { get; set; } + public Committer Author { get; set; } /// /// Gets or sets the person who applied the commit. If omitted, this will be filled in with the @@ -95,7 +95,7 @@ public NewCommit(string message, string tree, string parent) /// /// The committer. /// - public SignatureResponse Committer { get; set; } + public Committer Committer { get; set; } internal string DebuggerDisplay { diff --git a/Octokit/Models/Request/NewTag.cs b/Octokit/Models/Request/NewTag.cs index 96cb24e779..49050a0365 100644 --- a/Octokit/Models/Request/NewTag.cs +++ b/Octokit/Models/Request/NewTag.cs @@ -56,7 +56,7 @@ public class NewTag /// /// The tagger. /// - public SignatureResponse Tagger { get; set; } + public Committer Tagger { get; set; } internal string DebuggerDisplay { diff --git a/Octokit/Models/Response/Commit.cs b/Octokit/Models/Response/Commit.cs index d0b34756ad..374398c0bb 100644 --- a/Octokit/Models/Response/Commit.cs +++ b/Octokit/Models/Response/Commit.cs @@ -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 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 parents, int commentCount) : base(url, label, @ref, sha, user, repository) { Ensure.ArgumentNotNull(parents, "parents"); @@ -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; } diff --git a/Octokit/Models/Response/CommitEntity.cs b/Octokit/Models/Response/CommitEntity.cs deleted file mode 100644 index 5acbecbee5..0000000000 --- a/Octokit/Models/Response/CommitEntity.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Diagnostics; -using System.Globalization; - -namespace Octokit -{ - [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class CommitEntity - { - public CommitEntity() { } - - /// - /// Name of the user - /// - public string Name { get; protected set; } - - /// - /// Email of the user - /// - public string Email { get; protected set; } - - /// - /// Time the commit happened - /// - public DateTime Date { get; protected set; } - - internal string DebuggerDisplay - { - get - { - return String.Format(CultureInfo.InvariantCulture, - "CommitEntity: Name: {0}, Email: {1}, Date: {2}", Name, Email, Date); - } - } - } -} \ No newline at end of file diff --git a/Octokit/Models/Response/Committer.cs b/Octokit/Models/Response/Committer.cs new file mode 100644 index 0000000000..da46505f40 --- /dev/null +++ b/Octokit/Models/Response/Committer.cs @@ -0,0 +1,61 @@ +using System; +using System.Diagnostics; +using System.Globalization; + +namespace Octokit +{ + /// + /// 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. + /// + [DebuggerDisplay("{DebuggerDisplay,nq}")] + public class Committer + { + /// + /// Initializes a new instance of the class. + /// + public Committer() { } + + /// + /// Initializes a new instance of the class. + /// + /// The full name of the author or committer. + /// The email. + /// The date. + public Committer(string name, string email, DateTimeOffset date) + { + Name = name; + Email = email; + Date = date; + } + + /// + /// Gets the name of the author or committer. + /// + /// + /// The name. + /// + public string Name { get; protected set; } + + /// + /// Gets the email of the author or committer. + /// + /// + /// The email. + /// + public string Email { get; protected set; } + + /// + /// Gets the date of the author or contributor's contributions. + /// + /// + /// The date. + /// + public DateTimeOffset Date { get; protected set; } + + internal string DebuggerDisplay + { + get { return String.Format(CultureInfo.InvariantCulture, "Name: {0} Email: {1} Date: {2}", Name, Email, Date); } + } + } +} diff --git a/Octokit/Models/Response/GitHubCommit.cs b/Octokit/Models/Response/GitHubCommit.cs index 556252750d..3f3c679d08 100644 --- a/Octokit/Models/Response/GitHubCommit.cs +++ b/Octokit/Models/Response/GitHubCommit.cs @@ -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 parents, IReadOnlyList 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 parents, IReadOnlyList files) : base(url, label, @ref, sha, user, repository) { Author = author; @@ -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; } diff --git a/Octokit/Models/Response/GitTag.cs b/Octokit/Models/Response/GitTag.cs index 956880d22a..3b0b6d0e9d 100644 --- a/Octokit/Models/Response/GitTag.cs +++ b/Octokit/Models/Response/GitTag.cs @@ -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; @@ -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; } } diff --git a/Octokit/Models/Response/PullRequestCommit.cs b/Octokit/Models/Response/PullRequestCommit.cs index 94c2d330be..0ca38a4973 100644 --- a/Octokit/Models/Response/PullRequestCommit.cs +++ b/Octokit/Models/Response/PullRequestCommit.cs @@ -12,7 +12,7 @@ public class PullRequestCommit { public PullRequestCommit() { } - public PullRequestCommit(SignatureResponse author, Uri commentsUrl, Commit commit, SignatureResponse committer, Uri htmlUrl, IEnumerable parents, string sha, Uri url) + public PullRequestCommit(Committer author, Uri commentsUrl, Commit commit, Committer committer, Uri htmlUrl, IEnumerable parents, string sha, Uri url) { Ensure.ArgumentNotNull(parents, "parents"); @@ -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; } diff --git a/Octokit/Models/Response/SignatureResponse.cs b/Octokit/Models/Response/SignatureResponse.cs deleted file mode 100644 index a56f860990..0000000000 --- a/Octokit/Models/Response/SignatureResponse.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Diagnostics; -using System.Globalization; - -namespace Octokit -{ - [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class SignatureResponse - { - public SignatureResponse() { } - - public SignatureResponse(string name, string email, DateTimeOffset date) - { - Name = name; - Email = email; - Date = date; - } - - public string Name { get; protected set; } - - public string Email { get; protected set; } - - public DateTimeOffset Date { get; protected set; } - - internal string DebuggerDisplay - { - get { return String.Format(CultureInfo.InvariantCulture, "Name: {0} Email: {1} Date: {2}", Name, Email, Date); } - } - } -} diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 8b2387cd54..ac6f85e22a 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -379,7 +379,7 @@ - + @@ -403,7 +403,6 @@ - - \ No newline at end of file + diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index 32a51ff5a5..dcf0e36c00 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -385,7 +385,7 @@ - + @@ -411,7 +411,6 @@ - - \ No newline at end of file + diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index 2c630ce94c..1c66988cae 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -381,7 +381,7 @@ - + @@ -407,8 +407,7 @@ - - \ No newline at end of file + diff --git a/Octokit/Octokit-Portable.csproj b/Octokit/Octokit-Portable.csproj index 84c3a97fa1..831a637c53 100644 --- a/Octokit/Octokit-Portable.csproj +++ b/Octokit/Octokit-Portable.csproj @@ -375,7 +375,7 @@ - + @@ -400,7 +400,6 @@ - @@ -424,11 +423,11 @@ - - \ No newline at end of file + diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index b9af9386f9..609897848b 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -1,5 +1,5 @@  - + Debug @@ -379,7 +379,7 @@ - + @@ -404,7 +404,6 @@ - diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index c282bbd36b..f13073ae37 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -111,7 +111,6 @@ - @@ -311,7 +310,7 @@ - + @@ -435,10 +434,10 @@ - - \ No newline at end of file + diff --git a/ReleaseNotes.md b/ReleaseNotes.md index bc50b59b36..68f95a6802 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -5,6 +5,7 @@ * Improved: Added `Description` property to `NewTeam` to allow specifying a description for a team - via #915 @haacked * Improved: Added `Description` property to `OrganizationUpdate` to allow specifying a description for an organization - via #915 @haacked * Improved: Added `Before` property to `NotificationsRequest` to find notifications updated before a specific time - via #915 @haacked +* Improved: Renamed `SignatureResponse` to `Committer` and replaced `CommitEntity` with `Committer` - via @haacked * Fixed: Bug that prevented sepecifying a commit message for pull request merges - via #915 @haacked **Breaking Changes:**