-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathIGit.cs
More file actions
41 lines (36 loc) · 1.43 KB
/
Copy pathIGit.cs
File metadata and controls
41 lines (36 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using CliWrap;
using CliWrap.Buffered;
namespace Husky.Services.Contracts;
public interface IGit
{
Task<string[]> GetDiffNameOnlyAsync();
Task<string[]> GetStagedFilesAsync();
Task<string[]> GitFilesAsync();
Task<string[]> GetLastCommitFilesAsync();
Task<string> GetGitPathAsync();
Task<string> GetGitDirRelativePathAsync();
Task<string> GetCurrentBranchAsync();
Task<string> GetHuskyPathAsync();
/// <summary>
/// Checks if a given path is a submodule.
/// <see href="https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---show-superproject-working-tree">relevant git documentation</see>
/// </summary>
/// <param name="path">path to check</param>
/// <returns>true if submodule, false otherwise.</returns>
Task<bool> IsSubmodule(string path);
/// <summary>
/// Returns the path to the `.git` directory
/// </summary>
/// <param name="path">Target path for the git command</param>
/// <returns>Path to .git directory if found.</returns>
Task<string> GetGitDirectory(string path);
/// <summary>
/// only file additions and modifications
/// </summary>
/// <returns></returns>
Task<string[]> GetDiffStagedRecord();
Task<CommandResult> ExecAsync(string args);
Task<CommandResult> ExecAsync(IEnumerable<string> args);
Task<BufferedCommandResult> ExecBufferedAsync(string args);
Task<BufferedCommandResult> ExecBufferedAsync(IEnumerable<string> args);
}