Skip to content

Commit

Permalink
Feature/i11054 clean submodules (#11101)
Browse files Browse the repository at this point in the history
* Sign contributors.txt

* #11054 Add option to clean submodules

* Update translations

* Add Clean Submodules behaviour to Preview

* Remove unused import
  • Loading branch information
NatRavenhill committed Jul 22, 2023
1 parent 8b5eab5 commit 5a11dfd
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 179 deletions.
19 changes: 19 additions & 0 deletions GitCommands/Git/Commands/GitCommandHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,25 @@ public static ArgumentString CleanCmd(CleanMode mode, bool dryRun, bool director
};
}

/// <summary>
/// Arguments for cleaning submodules.
/// </summary>
/// <param name="mode">The cleanup mode what to delete.</param>
/// <param name="dryRun">Only show what would be deleted.</param>
/// <param name="directories">Delete untracked directories too.</param>
/// <param name="paths">Limit to specific paths.</param>
public static ArgumentString CleanSubmodules(CleanMode mode, bool dryRun, bool directories, string? paths = null)
{
return new GitArgumentBuilder("submodule")
{
"foreach --recursive git clean",
mode,
{ directories, "-d" },
{ dryRun, "--dry-run", "-f" },
paths
};
}

public static ArgumentString GetAllChangedFilesCmd(bool excludeIgnoredFiles, UntrackedFilesMode untrackedFiles, IgnoreSubmodulesMode ignoreSubmodules = IgnoreSubmodulesMode.None, bool noLocks = false)
{
GitArgumentBuilder args = new("status", gitOptions: noLocks ? (ArgumentString)"--no-optional-locks" : default)
Expand Down

0 comments on commit 5a11dfd

Please sign in to comment.