mirror of
https://github.com/actions/checkout.git
synced 2025-07-06 08:12:53 +00:00
Add exclude_from_clean
option
This commit is contained in:
parent
85e6279cec
commit
ed2311a594
10 changed files with 45 additions and 12 deletions
|
@ -57,7 +57,7 @@ export interface IGitCommandManager {
|
|||
submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void>
|
||||
submoduleStatus(): Promise<boolean>
|
||||
tagExists(pattern: string): Promise<boolean>
|
||||
tryClean(): Promise<boolean>
|
||||
tryClean(exclude_from_clean: string): Promise<boolean>
|
||||
tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean>
|
||||
tryDisableAutomaticGarbageCollection(): Promise<boolean>
|
||||
tryGetFetchUrl(): Promise<string>
|
||||
|
@ -434,8 +434,13 @@ class GitCommandManager {
|
|||
return !!output.stdout.trim()
|
||||
}
|
||||
|
||||
async tryClean(): Promise<boolean> {
|
||||
const output = await this.execGit(['clean', '-ffdx'], true)
|
||||
async tryClean(exclude_from_clean: string): Promise<boolean> {
|
||||
let output
|
||||
if (exclude_from_clean) {
|
||||
output = await this.execGit(['clean', '-ffdx', '-e', exclude_from_clean], true)
|
||||
} else {
|
||||
output = await this.execGit(['clean', '-ffdx'], true)
|
||||
}
|
||||
return output.exitCode === 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue