From 37d75c77486552d28cf177ac4a92db62fdd9234d Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sat, 17 May 2014 12:22:20 +1000 Subject: [PATCH] added opt-in header for passing Context to API --- Octokit/Clients/CommitStatusClient.cs | 14 ++++++++++++-- Octokit/Models/Response/CommitStatus.cs | 5 +++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Octokit/Clients/CommitStatusClient.cs b/Octokit/Clients/CommitStatusClient.cs index fae61f38..b83743ae 100644 --- a/Octokit/Clients/CommitStatusClient.cs +++ b/Octokit/Clients/CommitStatusClient.cs @@ -34,7 +34,12 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - return ApiConnection.GetAll(ApiUrls.CommitStatus(owner, name, reference), null); + // This is currently a preview feature of the API and is subject to change + // https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + return ApiConnection.GetAll( + ApiUrls.CommitStatus(owner, name, reference), + null, + "application/vnd.github.she-hulk-preview+json"); } /// @@ -52,7 +57,12 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); Ensure.ArgumentNotNull(commitStatus, "commitStatus"); - return ApiConnection.Post(ApiUrls.CommitStatus(owner, name, reference), commitStatus); + // This is currently a preview feature of the API and is subject to change + // https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + return ApiConnection.Post( + ApiUrls.CommitStatus(owner, name, reference), + commitStatus, + "application/vnd.github.she-hulk-preview+json"); } } } diff --git a/Octokit/Models/Response/CommitStatus.cs b/Octokit/Models/Response/CommitStatus.cs index fe457892..1e52e29e 100644 --- a/Octokit/Models/Response/CommitStatus.cs +++ b/Octokit/Models/Response/CommitStatus.cs @@ -33,6 +33,11 @@ namespace Octokit /// public string Description { get; set; } + /// + /// A string label to differentiate this status from the status of other systems. + /// + public string Context { get; set; } + /// /// The unique identifier of the status. ///