Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit be899c4

Browse files
Removing octokit
1 parent e63a914 commit be899c4

File tree

14 files changed

+13
-46
lines changed

14 files changed

+13
-46
lines changed

lib/dotnet-httpClient35/DotNetHttp35.dll

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/dotnet-httpClient35/DotNetHttp35.dll.mdb

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/dotnet-httpClient35/md5sums.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/dotnet-httpClient35/version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/octokit.net/Octokit.dll

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/octokit.net/Octokit.dll.mdb

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/octokit.net/md5sums.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/octokit.net/version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

script

src/GitHub.Api/Application/ApiClient.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using Octokit;
65
using GitHub.Logging;
76
using System.Runtime.Serialization;
87
using System.Text;
@@ -19,7 +18,6 @@ public static IApiClient Create(UriString repositoryUrl, IKeychain keychain, IPr
1918
var hostAddress = HostAddress.Create(repositoryUrl);
2019

2120
return new ApiClient(repositoryUrl, keychain,
22-
new GitHubClient(ApplicationConfiguration.ProductHeader, credentialStore, hostAddress.ApiUri),
2321
processManager, taskManager, nodeJsExecutablePath, octorunScriptPath);
2422
}
2523

@@ -34,11 +32,10 @@ public static IApiClient Create(UriString repositoryUrl, IKeychain keychain, IPr
3432
private readonly NPath octorunScriptPath;
3533
private readonly ILoginManager loginManager;
3634

37-
public ApiClient(UriString hostUrl, IKeychain keychain, IGitHubClient githubClient, IProcessManager processManager, ITaskManager taskManager, NPath nodeJsExecutablePath, NPath octorunScriptPath)
35+
public ApiClient(UriString hostUrl, IKeychain keychain, IProcessManager processManager, ITaskManager taskManager, NPath nodeJsExecutablePath, NPath octorunScriptPath)
3836
{
3937
Guard.ArgumentNotNull(hostUrl, nameof(hostUrl));
4038
Guard.ArgumentNotNull(keychain, nameof(keychain));
41-
Guard.ArgumentNotNull(githubClient, nameof(githubClient));
4239

4340
HostAddress = HostAddress.Create(hostUrl);
4441
OriginalUrl = hostUrl;
@@ -64,12 +61,12 @@ private async Task LogoutInternal(UriString host)
6461
await loginManager.Logout(host);
6562
}
6663

67-
public async Task CreateRepository(NewRepository newRepository, Action<GitHubRepository, Exception> callback, string organization = null)
64+
public async Task CreateRepository(string name, string description, bool isPrivate, Action<GitHubRepository, Exception> callback, string organization = null)
6865
{
6966
Guard.ArgumentNotNull(callback, "callback");
7067
try
7168
{
72-
var repository = await CreateRepositoryInternal(newRepository, organization);
69+
var repository = await CreateRepositoryInternal(name, organization, description, isPrivate);
7370
callback(repository, null);
7471
}
7572
catch (Exception e)
@@ -201,7 +198,7 @@ public async Task<bool> ContinueLoginAsync(LoginResult loginResult, Func<LoginRe
201198
return result.Code == LoginResultCodes.Success;
202199
}
203200

204-
private async Task<GitHubRepository> CreateRepositoryInternal(NewRepository newRepository, string organization)
201+
private async Task<GitHubRepository> CreateRepositoryInternal(string repositoryName, string organization, string description, bool isPrivate)
205202
{
206203
try
207204
{
@@ -214,12 +211,12 @@ private async Task<GitHubRepository> CreateRepositoryInternal(NewRepository newR
214211
var keychainAdapter = await keychain.Load(uriString);
215212

216213
var command = new StringBuilder("publish -r ");
217-
command.Append(newRepository.Name);
214+
command.Append(repositoryName);
218215

219-
if (!string.IsNullOrEmpty(newRepository.Description))
216+
if (!string.IsNullOrEmpty(description))
220217
{
221218
command.Append(" -d ");
222-
command.Append(newRepository.Description);
219+
command.Append(description);
223220
}
224221

225222
if (!string.IsNullOrEmpty(organization))
@@ -228,7 +225,7 @@ private async Task<GitHubRepository> CreateRepositoryInternal(NewRepository newR
228225
command.Append(organization);
229226
}
230227

231-
if (newRepository.Private ?? false)
228+
if (isPrivate)
232229
{
233230
command.Append(" -p");
234231
}

0 commit comments

Comments
 (0)