mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-02-26 21:15:43 +00:00
Merge f3b6b37fa6 into 0c366fd6a8
This commit is contained in:
commit
647245818b
3 changed files with 19 additions and 12 deletions
13
dist/index.js
vendored
13
dist/index.js
vendored
|
|
@ -780,9 +780,9 @@ class GitCommandManager {
|
|||
yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
|
||||
});
|
||||
}
|
||||
checkout(ref, startPoint) {
|
||||
checkout(ref, startPoint, showProgress) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['checkout', '--progress', '--force'];
|
||||
const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force'];
|
||||
if (startPoint) {
|
||||
args.push('-B', ref, startPoint);
|
||||
}
|
||||
|
|
@ -792,9 +792,9 @@ class GitCommandManager {
|
|||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
checkoutDetach() {
|
||||
checkoutDetach(showProgress) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['checkout', '--detach'];
|
||||
const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet'];
|
||||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
|
|
@ -1523,6 +1523,9 @@ function getSource(settings) {
|
|||
// Fetch
|
||||
core.startGroup('Fetching the repository');
|
||||
const fetchOptions = {};
|
||||
if (settings.showProgress) {
|
||||
fetchOptions.showProgress = true;
|
||||
}
|
||||
if (settings.filter) {
|
||||
fetchOptions.filter = settings.filter;
|
||||
}
|
||||
|
|
@ -1593,7 +1596,7 @@ function getSource(settings) {
|
|||
}
|
||||
// Checkout
|
||||
core.startGroup('Checking out the ref');
|
||||
yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
|
||||
yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint, settings.showProgress);
|
||||
core.endGroup();
|
||||
// Submodules
|
||||
if (settings.submodules) {
|
||||
|
|
|
|||
|
|
@ -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): Promise<void>
|
||||
checkoutDetach(): Promise<void>
|
||||
checkout(ref: string, startPoint: string, showProgress?: boolean): Promise<void>
|
||||
checkoutDetach(showProgress?: boolean): Promise<void>
|
||||
config(
|
||||
configKey: string,
|
||||
configValue: string,
|
||||
|
|
@ -220,8 +220,8 @@ class GitCommandManager {
|
|||
)
|
||||
}
|
||||
|
||||
async checkout(ref: string, startPoint: string): Promise<void> {
|
||||
const args = ['checkout', '--progress', '--force']
|
||||
async checkout(ref: string, startPoint: string, showProgress?: boolean): Promise<void> {
|
||||
const args = ['checkout', showProgress ? '--progress' : '--quiet', '--force']
|
||||
if (startPoint) {
|
||||
args.push('-B', ref, startPoint)
|
||||
} else {
|
||||
|
|
@ -231,8 +231,8 @@ class GitCommandManager {
|
|||
await this.execGit(args)
|
||||
}
|
||||
|
||||
async checkoutDetach(): Promise<void> {
|
||||
const args = ['checkout', '--detach']
|
||||
async checkoutDetach(showProgress?: boolean): Promise<void> {
|
||||
const args = ['checkout', '--detach', showProgress ? '--progress' : '--quiet']
|
||||
await this.execGit(args)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,10 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
showProgress?: boolean
|
||||
} = {}
|
||||
|
||||
if (settings.showProgress) {
|
||||
fetchOptions.showProgress = true
|
||||
}
|
||||
|
||||
if (settings.filter) {
|
||||
fetchOptions.filter = settings.filter
|
||||
} else if (settings.sparseCheckout) {
|
||||
|
|
@ -251,7 +255,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
|
||||
// Checkout
|
||||
core.startGroup('Checking out the ref')
|
||||
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint)
|
||||
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint, settings.showProgress)
|
||||
core.endGroup()
|
||||
|
||||
// Submodules
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue