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

Expose more API points #1057

Merged
merged 2 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GitHub.Api/Application/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

[Serializable]
class TokenUsernameMismatchException : ApiClientException
public class TokenUsernameMismatchException : ApiClientException
{
public string CachedUsername { get; }
public string CurrentUsername { get; }
Expand All @@ -520,7 +520,7 @@ protected TokenUsernameMismatchException(SerializationInfo info, StreamingContex
}

[Serializable]
class KeychainEmptyException : ApiClientException
public class KeychainEmptyException : ApiClientException
{
public KeychainEmptyException()
{
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Application/ApplicationManagerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace GitHub.Unity
{
class ApplicationManagerBase : IApplicationManager
public class ApplicationManagerBase : IApplicationManager
{
protected static ILogging Logger { get; } = LogHelper.GetLogger<IApplicationManager>();

Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Authentication/Keychain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public bool Equals(Connection other)
}
}

class Keychain : IKeychain
public class Keychain : IKeychain
{
const string ConnectionFile = "connections.json";

Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Authentication/KeychainAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GitHub.Unity
{
class KeychainAdapter : IKeychainAdapter
public class KeychainAdapter : IKeychainAdapter
{
public ICredential Credential { get; private set; }

Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Authentication/LoginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum LoginResultCodes
/// <summary>
/// Provides services for logging into a GitHub server.
/// </summary>
class LoginManager : ILoginManager
public class LoginManager : ILoginManager
{
private readonly ILogging logger = LogHelper.GetLogger<LoginManager>();

Expand Down Expand Up @@ -233,7 +233,7 @@ private string RetrieveUsername(string token, UriString host)
}
}

class LoginResultData
public class LoginResultData
{
public LoginResultCodes Code;
public string Message;
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Events/RepositoryWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace GitHub.Unity
{
interface IRepositoryWatcher : IDisposable
public interface IRepositoryWatcher : IDisposable
{
void Start();
void Stop();
Expand All @@ -23,7 +23,7 @@ interface IRepositoryWatcher : IDisposable
int CheckAndProcessEvents();
}

class RepositoryWatcher : IRepositoryWatcher
public class RepositoryWatcher : IRepositoryWatcher
{
private readonly RepositoryPathConfiguration paths;
private readonly CancellationToken cancellationToken;
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/FailureSeverity.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace GitHub.Unity
{
enum FailureSeverity
public enum FailureSeverity
{
Moderate,
Critical
};
}
}
1 change: 1 addition & 0 deletions src/GitHub.Api/Git/GitClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using GitHub.Unity.Git.Tasks;
using static GitHub.Unity.GitInstaller;

namespace GitHub.Unity
Expand Down
8 changes: 4 additions & 4 deletions src/GitHub.Api/Git/GitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public interface IGitConfig
void SetInt(string section, string key, int value);
}

class GitConfig : IGitConfig
public class GitConfig : IGitConfig
{
private readonly ConfigFileManager manager;
private SectionParser sectionParser;
Expand Down Expand Up @@ -296,7 +296,7 @@ private void SetAndWrite(string section, string key, string value)
manager.Save(sb.ToString());
}

class Section : Dictionary<string, List<string>>
public class Section : Dictionary<string, List<string>>
{
public Section(string name, string description = null)
{
Expand Down Expand Up @@ -364,7 +364,7 @@ public override string ToString()
public string Description { get; private set; }
}

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

class ConfigFileManager
public class ConfigFileManager
{
private static readonly string[] emptyContents = new string[0];

Expand Down
3 changes: 2 additions & 1 deletion src/GitHub.Api/Git/GitCredentialManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using GitHub.Unity.Git.Tasks;

namespace GitHub.Unity
{
class GitCredentialManager : ICredentialManager
public class GitCredentialManager : ICredentialManager
{
private static ILogging Logger { get; } = LogHelper.GetLogger<GitCredentialManager>();

Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Git/GitObjectFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace GitHub.Unity
{
class GitObjectFactory : IGitObjectFactory
public class GitObjectFactory : IGitObjectFactory
{
private readonly IEnvironment environment;

Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Git/IGitObjectFactory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GitHub.Unity
{
interface IGitObjectFactory
public interface IGitObjectFactory
{
GitStatusEntry CreateGitStatusEntry(string path, GitFileStatus status, string originalPath = null, bool staged = false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Git/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface IBackedByCache
}

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

Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.Api/Git/RepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface IRepositoryManager : IDisposable
bool IsBusy { get; }
}

interface IRepositoryPathConfiguration
public interface IRepositoryPathConfiguration
{
NPath RepositoryPath { get; }
NPath DotGitPath { get; }
Expand All @@ -68,7 +68,7 @@ interface IRepositoryPathConfiguration
bool IsWorktree { get; }
}

class RepositoryPathConfiguration : IRepositoryPathConfiguration
public class RepositoryPathConfiguration : IRepositoryPathConfiguration
{
public RepositoryPathConfiguration(NPath repositoryPath)
{
Expand Down Expand Up @@ -124,7 +124,7 @@ public RepositoryPathConfiguration(NPath repositoryPath)
public NPath DotGitCommitEditMsg { get; }
}

class RepositoryManager : IRepositoryManager
public class RepositoryManager : IRepositoryManager
{
private readonly IGitConfig config;
private readonly IGitClient gitClient;
Expand Down
5 changes: 2 additions & 3 deletions src/GitHub.Api/Git/Tasks/GitAddTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitAddTask : ProcessTask<string>
public class GitAddTask : ProcessTask<string>
{
private const string TaskName = "git add";
private readonly string arguments;
Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.Api/Git/Tasks/GitAheadBehindStatusTask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitAheadBehindStatusTask : ProcessTask<GitAheadBehindStatus>
public class GitAheadBehindStatusTask : ProcessTask<GitAheadBehindStatus>
{
private const string TaskName = "git rev-list";
private readonly string arguments;
Expand All @@ -19,4 +19,4 @@ public GitAheadBehindStatusTask(string gitRef, string otherRef,
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
public override string Message { get; set; } = "Querying status...";
}
}
}
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitBranchCreateTask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitBranchCreateTask : ProcessTask<string>
public class GitBranchCreateTask : ProcessTask<string>
{
private const string TaskName = "git branch";
private readonly string arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitBranchDeleteTask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitBranchDeleteTask : ProcessTask<string>
public class GitBranchDeleteTask : ProcessTask<string>
{
private const string TaskName = "git branch -d";
private readonly string arguments;
Expand Down
7 changes: 3 additions & 4 deletions src/GitHub.Api/Git/Tasks/GitCheckoutTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitCheckoutTask : ProcessTask<string>
public class GitCheckoutTask : ProcessTask<string>
{
private const string TaskName = "git checkout";
private readonly string arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitCommitTask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitCommitTask : ProcessTask<string>
public class GitCommitTask : ProcessTask<string>
{
private const string TaskName = "git commit";

Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitConfigGetTask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitConfigGetAllTask : ProcessTaskWithListOutput<string>
public class GitConfigGetAllTask : ProcessTaskWithListOutput<string>
{
private const string TaskName = "git config get";
private readonly string arguments;
Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.Api/Git/Tasks/GitConfigListTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitConfigListTask : ProcessTaskWithListOutput<KeyValuePair<string, string>>
public class GitConfigListTask : ProcessTaskWithListOutput<KeyValuePair<string, string>>
{
private const string TaskName = "git config list";
private readonly string arguments;
Expand All @@ -30,4 +30,4 @@ public GitConfigListTask(GitConfigSource configSource, CancellationToken token,
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
public override string Message { get; set; } = "Reading configuration...";
}
}
}
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitConfigSetTask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitConfigSetTask : ProcessTask<string>
public class GitConfigSetTask : ProcessTask<string>
{
private readonly string arguments;

Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.Api/Git/Tasks/GitConfigUnSetTask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitConfigUnSetTask : ProcessTask<string>
public class GitConfigUnSetTask : ProcessTask<string>
{
private readonly string arguments;

Expand All @@ -25,4 +25,4 @@ public GitConfigUnSetTask(string key, GitConfigSource configSource,
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
public override string Message { get; set; } = "Writing configuration...";
}
}
}
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitCountObjectsTask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitCountObjectsTask : ProcessTask<int>
public class GitCountObjectsTask : ProcessTask<int>
{
private const string TaskName = "git count-objects";

Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitFetchTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitFetchTask : ProcessTask<string>
public class GitFetchTask : ProcessTask<string>
{
private const string TaskName = "git fetch";
private readonly string arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.Api/Git/Tasks/GitInitTask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading;

namespace GitHub.Unity
namespace GitHub.Unity.Git.Tasks
{
class GitInitTask : ProcessTask<string>
public class GitInitTask : ProcessTask<string>
{
private const string TaskName = "git init";

Expand Down
Loading