From ecd5f5d13936dd097b12766cb95a568ad5b073a9 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:04:59 +1000 Subject: feat: lots of stuff --- src/marlin.core/functional/GitBinaryClient.cs | 9 ++++++++- src/marlin.core/functional/IGitClient.cs | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/marlin.core/functional') diff --git a/src/marlin.core/functional/GitBinaryClient.cs b/src/marlin.core/functional/GitBinaryClient.cs index 3a703da..b2751c0 100644 --- a/src/marlin.core/functional/GitBinaryClient.cs +++ b/src/marlin.core/functional/GitBinaryClient.cs @@ -41,6 +41,13 @@ public class GitBinaryClient : IGitClient await this.RunAsync(authenticate: true, args.ToArray()); } + public async Task Checkout(string repoPath, string remote, string branch, string commit) + { + await this.RunAsync(authenticate: true, "clone", "--revision", branch, remote, repoPath); + // await this.RunAsync(authenticate: true, "clone", "--branch", branch, remote, repoPath); + await this.RunAsync(authenticate: false, "-C", repoPath, "checkout", commit); + } + public async Task ListTree(string repoPath, string hash, string filterPath = ".") { string stdout = await this.RunAsync( @@ -84,7 +91,7 @@ public class GitBinaryClient : IGitClient foreach (string arg in arguments) psi.ArgumentList.Add(arg); - + psi.Environment["GIT_TERMINAL_PROMPT"] = "0"; IAsyncDisposable? credentialScope = authenticate && this._credential != null diff --git a/src/marlin.core/functional/IGitClient.cs b/src/marlin.core/functional/IGitClient.cs index 69cffa3..69476d3 100644 --- a/src/marlin.core/functional/IGitClient.cs +++ b/src/marlin.core/functional/IGitClient.cs @@ -5,6 +5,7 @@ public interface IGitClient Task> GetRemoteRefs(string remote); Task Init(string repoPath); Task FetchTrees(string repoPath, string remote, IEnumerable refs, bool skipBlobs = false); + Task Checkout(string repoPath, string remote, string branch, string commit); Task ListTree(string repoPath, string hash, string filterPath = "."); Task CatFile(string repoPath, string hash, string fileName); } \ No newline at end of file -- cgit v1.3.1