diff --git a/Services/GitService.cs b/Services/GitService.cs index f561535..ca81af6 100644 --- a/Services/GitService.cs +++ b/Services/GitService.cs @@ -109,7 +109,7 @@ public partial class GitService : IGitService CancellationToken ct = default) { progress?.Report("Fetching from remote..."); - var (exitCode, _, error) = await RunGitCommandAsync(path, "fetch --all --prune", ct); + var (exitCode, _, error) = await RunGitCommandAsync(path, "fetch --all --prune --recurse-submodules", ct); if (exitCode != 0) progress?.Report($"Fetch failed: {error}"); @@ -121,7 +121,7 @@ public partial class GitService : IGitService CancellationToken ct = default) { progress?.Report("Pulling changes..."); - var (exitCode, _, error) = await RunGitCommandAsync(path, "pull --ff-only", ct); + var (exitCode, _, error) = await RunGitCommandAsync(path, "pull --ff-only --recurse-submodules", ct); if (exitCode != 0) progress?.Report($"Pull failed: {error}"); @@ -139,7 +139,7 @@ public partial class GitService : IGitService var (exitCode, error) = await RunGitCommandWithProgressAsync( parentDir, - $"clone --progress \"{url}\" \"{folderName}\"", + $"clone --progress --recurse-submodules \"{url}\" \"{folderName}\"", percentProgress, ct, timeoutMs: 300000); // 5 minute timeout for clone @@ -167,7 +167,11 @@ public partial class GitService : IGitService public async Task CheckoutAsync(string path, string branchOrCommit, CancellationToken ct = default) { var (exitCode, _, _) = await RunGitCommandAsync(path, $"checkout \"{branchOrCommit}\"", ct); - return exitCode == 0; + if (exitCode != 0) + return false; + + await RunGitCommandAsync(path, "submodule update --init --recursive", ct); + return true; } public async Task HasLocalChangesAsync(string path, CancellationToken ct = default) diff --git a/packages.lock.json b/packages.lock.json index 71754a8..8ab699c 100644 --- a/packages.lock.json +++ b/packages.lock.json @@ -29,6 +29,7 @@ "Spectre.Console": "0.53.1" } } - } + }, + "net10.0/linux-x64": {} } } \ No newline at end of file