Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 00441d9

Browse files
linquizeRubenWillems
authored andcommitted
Git clean should also clean submodule work trees recursively
1 parent 587f6dd commit 00441d9

File tree

1 file changed

+10
-0
lines changed
  • project/core/sourcecontrol

1 file changed

+10
-0
lines changed

project/core/sourcecontrol/Git.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,16 @@ private void GitClean(IIntegrationResult result)
669669
buffer.AddArgument("-f");
670670
buffer.AddArgument("-x");
671671
Execute(NewProcessInfo(buffer.ToString(), result));
672+
673+
if (FetchSubmodules)
674+
{
675+
buffer = new ProcessArgumentBuilder();
676+
buffer.AddArgument("submodule");
677+
buffer.AddArgument("foreach");
678+
buffer.AddArgument("--recursive");
679+
buffer.AddArgument("\"git clean -d -f -x\"");
680+
Execute(NewProcessInfo(buffer.ToString(), result));
681+
}
672682
}
673683

674684
/// <summary>

0 commit comments

Comments
 (0)