mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 02:45:32 +00:00
@@ -22,7 +22,6 @@ namespace Octokit
|
||||
/// Constructs an instance of ApiValidationException
|
||||
/// </summary>
|
||||
public InvalidGitIgnoreTemplateException()
|
||||
: base()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,34 +16,18 @@ namespace Octokit
|
||||
|
||||
public static IList<string> Clone(this IReadOnlyList<string> input)
|
||||
{
|
||||
List<string> output = null;
|
||||
if (input == null)
|
||||
return output;
|
||||
return null;
|
||||
|
||||
output = new List<string>();
|
||||
|
||||
foreach (var item in input)
|
||||
{
|
||||
output.Add(new String(item.ToCharArray()));
|
||||
}
|
||||
|
||||
return output;
|
||||
return input.Select(item => new String(item.ToCharArray())).ToList();
|
||||
}
|
||||
|
||||
public static IDictionary<string, Uri> Clone(this IReadOnlyDictionary<string, Uri> input)
|
||||
{
|
||||
Dictionary<string, Uri> output = null;
|
||||
if (input == null)
|
||||
return output;
|
||||
return null;
|
||||
|
||||
output = new Dictionary<string, Uri>();
|
||||
|
||||
foreach (var item in input)
|
||||
{
|
||||
output.Add(new String(item.Key.ToCharArray()), new Uri(item.Value.ToString()));
|
||||
}
|
||||
|
||||
return output;
|
||||
return input.ToDictionary(item => new String(item.Key.ToCharArray()), item => new Uri(item.Value.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Octokit
|
||||
if (optionalQueryStringMatch.Success)
|
||||
{
|
||||
var expansion = string.Empty;
|
||||
var parameters = optionalQueryStringMatch.Groups[1].Value.Split(new char[] { ',' });
|
||||
var parameters = optionalQueryStringMatch.Groups[1].Value.Split(',');
|
||||
|
||||
foreach (var parameter in parameters)
|
||||
{
|
||||
|
||||
@@ -60,14 +60,14 @@ namespace Octokit
|
||||
{
|
||||
// Seem to have to do this to pass a whole bunch of tests (for example Octokit.Tests.Clients.EventsClientTests.DeserializesCommitCommentEventCorrectly)
|
||||
// I believe this has something to do with the Mocking framework.
|
||||
if (this.Links == null || this.OauthScopes == null || this.RateLimit == null || this.Etag == null)
|
||||
if (Links == null || OauthScopes == null || RateLimit == null || Etag == null)
|
||||
return null;
|
||||
|
||||
return new ApiInfo(this.Links.Clone(),
|
||||
this.OauthScopes.Clone(),
|
||||
this.AcceptedOauthScopes.Clone(),
|
||||
return new ApiInfo(Links.Clone(),
|
||||
OauthScopes.Clone(),
|
||||
AcceptedOauthScopes.Clone(),
|
||||
new String(this.Etag.ToCharArray()),
|
||||
this.RateLimit.Clone());
|
||||
RateLimit.Clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Octokit.Internal
|
||||
{
|
||||
newRequest.Headers.Authorization = null;
|
||||
}
|
||||
response = await this.SendAsync(newRequest, cancellationToken);
|
||||
response = await SendAsync(newRequest, cancellationToken);
|
||||
}
|
||||
|
||||
return response;
|
||||
|
||||
@@ -108,9 +108,9 @@ namespace Octokit
|
||||
{
|
||||
return new RateLimit
|
||||
{
|
||||
Limit = this.Limit,
|
||||
Remaining = this.Remaining,
|
||||
ResetAsUtcEpochSeconds = this.ResetAsUtcEpochSeconds
|
||||
Limit = Limit,
|
||||
Remaining = Remaining,
|
||||
ResetAsUtcEpochSeconds = ResetAsUtcEpochSeconds
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Octokit
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get { return this.Repository.FullName; }
|
||||
get { return Repository.FullName; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user