Skip to content

Commit

Permalink
run all git operations shallow
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Dec 16, 2024
1 parent ae0d318 commit e529c3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Plogon/BuildProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -985,11 +985,16 @@ public async Task<BuildResult> ProcessTask(BuildTask task, bool commit, string?
{
Checkout = false,
RecurseSubmodules = false,
FetchOptions =
{
Depth = 1,
}
});

var repo = new Repository(workDir.FullName);
Commands.Fetch(repo, "origin", new [] { task.Manifest.Plugin.Commit }, new FetchOptions
{
Depth = 1,
}, null);
repo.Reset(ResetMode.Hard, task.Manifest.Plugin.Commit);

Expand Down Expand Up @@ -1407,6 +1412,10 @@ private void FetchSubmodules(Repository repo, HashSet<BuildResult.ReviewedNeed>
repo.Submodules.Update(submodule.Name, new SubmoduleUpdateOptions
{
Init = true,
FetchOptions =
{
Depth = 1,
}
});

reviewedNeeds.Add(GetNeedStatus(submodule.Url, submodule.WorkDirCommitId.Sha, State.Need.NeedType.Submodule));
Expand Down

0 comments on commit e529c3c

Please sign in to comment.