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

Commit 2802e84

Browse files
authored
Merge pull request #1057 from github-for-unity/more-api
Expose more API points
2 parents 0b7f579 + 4bd6d35 commit 2802e84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+115
-116
lines changed

src/GitHub.Api/Application/ApiClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace GitHub.Unity
1313
{
14-
class ApiClient : IApiClient
14+
public class ApiClient : IApiClient
1515
{
1616
private static readonly ILogging logger = LogHelper.GetLogger<ApiClient>();
1717
private static readonly Regex httpStatusErrorRegex = new Regex("(?<=[a-z])([A-Z])", RegexOptions.Compiled);
@@ -505,7 +505,7 @@ protected ApiClientException(SerializationInfo info, StreamingContext context) :
505505
}
506506

507507
[Serializable]
508-
class TokenUsernameMismatchException : ApiClientException
508+
public class TokenUsernameMismatchException : ApiClientException
509509
{
510510
public string CachedUsername { get; }
511511
public string CurrentUsername { get; }
@@ -520,7 +520,7 @@ protected TokenUsernameMismatchException(SerializationInfo info, StreamingContex
520520
}
521521

522522
[Serializable]
523-
class KeychainEmptyException : ApiClientException
523+
public class KeychainEmptyException : ApiClientException
524524
{
525525
public KeychainEmptyException()
526526
{

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace GitHub.Unity
99
{
10-
class ApplicationManagerBase : IApplicationManager
10+
public class ApplicationManagerBase : IApplicationManager
1111
{
1212
protected static ILogging Logger { get; } = LogHelper.GetLogger<IApplicationManager>();
1313

src/GitHub.Api/Authentication/Keychain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public bool Equals(Connection other)
6767
}
6868
}
6969

70-
class Keychain : IKeychain
70+
public class Keychain : IKeychain
7171
{
7272
const string ConnectionFile = "connections.json";
7373

src/GitHub.Api/Authentication/KeychainAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace GitHub.Unity
22
{
3-
class KeychainAdapter : IKeychainAdapter
3+
public class KeychainAdapter : IKeychainAdapter
44
{
55
public ICredential Credential { get; private set; }
66

src/GitHub.Api/Authentication/LoginManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum LoginResultCodes
1616
/// <summary>
1717
/// Provides services for logging into a GitHub server.
1818
/// </summary>
19-
class LoginManager : ILoginManager
19+
public class LoginManager : ILoginManager
2020
{
2121
private readonly ILogging logger = LogHelper.GetLogger<LoginManager>();
2222

@@ -233,7 +233,7 @@ private string RetrieveUsername(string token, UriString host)
233233
}
234234
}
235235

236-
class LoginResultData
236+
public class LoginResultData
237237
{
238238
public LoginResultCodes Code;
239239
public string Message;

src/GitHub.Api/Events/RepositoryWatcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace GitHub.Unity
1010
{
11-
interface IRepositoryWatcher : IDisposable
11+
public interface IRepositoryWatcher : IDisposable
1212
{
1313
void Start();
1414
void Stop();
@@ -23,7 +23,7 @@ interface IRepositoryWatcher : IDisposable
2323
int CheckAndProcessEvents();
2424
}
2525

26-
class RepositoryWatcher : IRepositoryWatcher
26+
public class RepositoryWatcher : IRepositoryWatcher
2727
{
2828
private readonly RepositoryPathConfiguration paths;
2929
private readonly CancellationToken cancellationToken;

src/GitHub.Api/Git/FailureSeverity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace GitHub.Unity
22
{
3-
enum FailureSeverity
3+
public enum FailureSeverity
44
{
55
Moderate,
66
Critical
77
};
8-
}
8+
}

src/GitHub.Api/Git/GitClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Threading;
5+
using GitHub.Unity.Git.Tasks;
56
using static GitHub.Unity.GitInstaller;
67

78
namespace GitHub.Unity

src/GitHub.Api/Git/GitConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public interface IGitConfig
167167
void SetInt(string section, string key, int value);
168168
}
169169

170-
class GitConfig : IGitConfig
170+
public class GitConfig : IGitConfig
171171
{
172172
private readonly ConfigFileManager manager;
173173
private SectionParser sectionParser;
@@ -296,7 +296,7 @@ private void SetAndWrite(string section, string key, string value)
296296
manager.Save(sb.ToString());
297297
}
298298

299-
class Section : Dictionary<string, List<string>>
299+
public class Section : Dictionary<string, List<string>>
300300
{
301301
public Section(string name, string description = null)
302302
{
@@ -364,7 +364,7 @@ public override string ToString()
364364
public string Description { get; private set; }
365365
}
366366

367-
class SectionParser
367+
public class SectionParser
368368
{
369369
private static readonly Regex CommentPattern = new Regex(@"^[;#].*", RegexOptions.Compiled);
370370
private static readonly Regex SectionPattern = new Regex(@"^\[(.*)\]$", RegexOptions.Compiled);
@@ -463,7 +463,7 @@ private void EnsureFileBeginsWithSection()
463463
public Dictionary<string, Dictionary<string, Section>> GroupSections { get; private set; }
464464
}
465465

466-
class ConfigFileManager
466+
public class ConfigFileManager
467467
{
468468
private static readonly string[] emptyContents = new string[0];
469469

src/GitHub.Api/Git/GitCredentialManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;
5+
using GitHub.Unity.Git.Tasks;
56

67
namespace GitHub.Unity
78
{
8-
class GitCredentialManager : ICredentialManager
9+
public class GitCredentialManager : ICredentialManager
910
{
1011
private static ILogging Logger { get; } = LogHelper.GetLogger<GitCredentialManager>();
1112

src/GitHub.Api/Git/GitObjectFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace GitHub.Unity
55
{
6-
class GitObjectFactory : IGitObjectFactory
6+
public class GitObjectFactory : IGitObjectFactory
77
{
88
private readonly IEnvironment environment;
99

src/GitHub.Api/Git/IGitObjectFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace GitHub.Unity
22
{
3-
interface IGitObjectFactory
3+
public interface IGitObjectFactory
44
{
55
GitStatusEntry CreateGitStatusEntry(string path, GitFileStatus status, string originalPath = null, bool staged = false);
66
}

src/GitHub.Api/Git/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface IBackedByCache
1313
}
1414

1515
[DebuggerDisplay("{DebuggerDisplay,nq}")]
16-
sealed class Repository : IEquatable<Repository>, IRepository
16+
public class Repository : IEquatable<Repository>, IRepository
1717
{
1818
private static ILogging Logger = LogHelper.GetLogger<Repository>();
1919

src/GitHub.Api/Git/RepositoryManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public interface IRepositoryManager : IDisposable
5555
bool IsBusy { get; }
5656
}
5757

58-
interface IRepositoryPathConfiguration
58+
public interface IRepositoryPathConfiguration
5959
{
6060
NPath RepositoryPath { get; }
6161
NPath DotGitPath { get; }
@@ -68,7 +68,7 @@ interface IRepositoryPathConfiguration
6868
bool IsWorktree { get; }
6969
}
7070

71-
class RepositoryPathConfiguration : IRepositoryPathConfiguration
71+
public class RepositoryPathConfiguration : IRepositoryPathConfiguration
7272
{
7373
public RepositoryPathConfiguration(NPath repositoryPath)
7474
{
@@ -124,7 +124,7 @@ public RepositoryPathConfiguration(NPath repositoryPath)
124124
public NPath DotGitCommitEditMsg { get; }
125125
}
126126

127-
class RepositoryManager : IRepositoryManager
127+
public class RepositoryManager : IRepositoryManager
128128
{
129129
private readonly IGitConfig config;
130130
private readonly IGitClient gitClient;

src/GitHub.Api/Git/Tasks/GitAddTask.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Threading;
43

5-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
65
{
7-
class GitAddTask : ProcessTask<string>
6+
public class GitAddTask : ProcessTask<string>
87
{
98
private const string TaskName = "git add";
109
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitAheadBehindStatusTask.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Threading;
22

3-
namespace GitHub.Unity
3+
namespace GitHub.Unity.Git.Tasks
44
{
5-
class GitAheadBehindStatusTask : ProcessTask<GitAheadBehindStatus>
5+
public class GitAheadBehindStatusTask : ProcessTask<GitAheadBehindStatus>
66
{
77
private const string TaskName = "git rev-list";
88
private readonly string arguments;
@@ -19,4 +19,4 @@ public GitAheadBehindStatusTask(string gitRef, string otherRef,
1919
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
2020
public override string Message { get; set; } = "Querying status...";
2121
}
22-
}
22+
}

src/GitHub.Api/Git/Tasks/GitBranchCreateTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33

4-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
55
{
6-
class GitBranchCreateTask : ProcessTask<string>
6+
public class GitBranchCreateTask : ProcessTask<string>
77
{
88
private const string TaskName = "git branch";
99
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitBranchDeleteTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Threading;
22

3-
namespace GitHub.Unity
3+
namespace GitHub.Unity.Git.Tasks
44
{
5-
class GitBranchDeleteTask : ProcessTask<string>
5+
public class GitBranchDeleteTask : ProcessTask<string>
66
{
77
private const string TaskName = "git branch -d";
88
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitCheckoutTask.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Threading;
43

5-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
65
{
7-
class GitCheckoutTask : ProcessTask<string>
6+
public class GitCheckoutTask : ProcessTask<string>
87
{
98
private const string TaskName = "git checkout";
109
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitCommitTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33

4-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
55
{
6-
class GitCommitTask : ProcessTask<string>
6+
public class GitCommitTask : ProcessTask<string>
77
{
88
private const string TaskName = "git commit";
99

src/GitHub.Api/Git/Tasks/GitConfigGetTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33

4-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
55
{
6-
class GitConfigGetAllTask : ProcessTaskWithListOutput<string>
6+
public class GitConfigGetAllTask : ProcessTaskWithListOutput<string>
77
{
88
private const string TaskName = "git config get";
99
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitConfigListTask.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using System.Collections.Generic;
33
using System.Threading;
44

5-
namespace GitHub.Unity
5+
namespace GitHub.Unity.Git.Tasks
66
{
7-
class GitConfigListTask : ProcessTaskWithListOutput<KeyValuePair<string, string>>
7+
public class GitConfigListTask : ProcessTaskWithListOutput<KeyValuePair<string, string>>
88
{
99
private const string TaskName = "git config list";
1010
private readonly string arguments;
@@ -30,4 +30,4 @@ public GitConfigListTask(GitConfigSource configSource, CancellationToken token,
3030
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
3131
public override string Message { get; set; } = "Reading configuration...";
3232
}
33-
}
33+
}

src/GitHub.Api/Git/Tasks/GitConfigSetTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33

4-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
55
{
6-
class GitConfigSetTask : ProcessTask<string>
6+
public class GitConfigSetTask : ProcessTask<string>
77
{
88
private readonly string arguments;
99

src/GitHub.Api/Git/Tasks/GitConfigUnSetTask.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33

4-
namespace GitHub.Unity
4+
namespace GitHub.Unity.Git.Tasks
55
{
6-
class GitConfigUnSetTask : ProcessTask<string>
6+
public class GitConfigUnSetTask : ProcessTask<string>
77
{
88
private readonly string arguments;
99

@@ -25,4 +25,4 @@ public GitConfigUnSetTask(string key, GitConfigSource configSource,
2525
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
2626
public override string Message { get; set; } = "Writing configuration...";
2727
}
28-
}
28+
}

src/GitHub.Api/Git/Tasks/GitCountObjectsTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Threading;
22

3-
namespace GitHub.Unity
3+
namespace GitHub.Unity.Git.Tasks
44
{
5-
class GitCountObjectsTask : ProcessTask<int>
5+
public class GitCountObjectsTask : ProcessTask<int>
66
{
77
private const string TaskName = "git count-objects";
88

src/GitHub.Api/Git/Tasks/GitFetchTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using System.Collections.Generic;
33
using System.Threading;
44

5-
namespace GitHub.Unity
5+
namespace GitHub.Unity.Git.Tasks
66
{
7-
class GitFetchTask : ProcessTask<string>
7+
public class GitFetchTask : ProcessTask<string>
88
{
99
private const string TaskName = "git fetch";
1010
private readonly string arguments;

src/GitHub.Api/Git/Tasks/GitInitTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Threading;
22

3-
namespace GitHub.Unity
3+
namespace GitHub.Unity.Git.Tasks
44
{
5-
class GitInitTask : ProcessTask<string>
5+
public class GitInitTask : ProcessTask<string>
66
{
77
private const string TaskName = "git init";
88

0 commit comments

Comments
 (0)