mirror of
https://github.com/actions/checkout.git
synced 2026-03-01 08:31:03 +08:00
Make showProgress a required argument for checkout and checkoutDetach
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a5d425690b
commit
197ee88ce5
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1310,7 +1310,7 @@ function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref
|
||||
core.startGroup('Removing previously created refs, to avoid conflicts');
|
||||
// Checkout detached HEAD
|
||||
if (!(yield git.isDetached())) {
|
||||
yield git.checkoutDetach();
|
||||
yield git.checkoutDetach(false);
|
||||
}
|
||||
// Remove all refs/heads/*
|
||||
let branches = yield git.branchList(false);
|
||||
|
||||
@ -22,8 +22,8 @@ export interface IGitCommandManager {
|
||||
disableSparseCheckout(): Promise<void>
|
||||
sparseCheckout(sparseCheckout: string[]): Promise<void>
|
||||
sparseCheckoutNonConeMode(sparseCheckout: string[]): Promise<void>
|
||||
checkout(ref: string, startPoint: string, showProgress?: boolean): Promise<void>
|
||||
checkoutDetach(showProgress?: boolean): Promise<void>
|
||||
checkout(ref: string, startPoint: string, showProgress: boolean): Promise<void>
|
||||
checkoutDetach(showProgress: boolean): Promise<void>
|
||||
config(
|
||||
configKey: string,
|
||||
configValue: string,
|
||||
@ -220,7 +220,7 @@ class GitCommandManager {
|
||||
)
|
||||
}
|
||||
|
||||
async checkout(ref: string, startPoint: string, showProgress?: boolean): Promise<void> {
|
||||
async checkout(ref: string, startPoint: string, showProgress: boolean): Promise<void> {
|
||||
const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force']
|
||||
if (startPoint) {
|
||||
args.push('-B', ref, startPoint)
|
||||
@ -231,7 +231,7 @@ class GitCommandManager {
|
||||
await this.execGit(args)
|
||||
}
|
||||
|
||||
async checkoutDetach(showProgress?: boolean): Promise<void> {
|
||||
async checkoutDetach(showProgress: boolean): Promise<void> {
|
||||
const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet']
|
||||
await this.execGit(args)
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ export async function prepareExistingDirectory(
|
||||
core.startGroup('Removing previously created refs, to avoid conflicts')
|
||||
// Checkout detached HEAD
|
||||
if (!(await git.isDetached())) {
|
||||
await git.checkoutDetach()
|
||||
await git.checkoutDetach(false)
|
||||
}
|
||||
|
||||
// Remove all refs/heads/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user