3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2026-02-27 05:25:40 +00:00

Thread showProgress through checkout and fix fetch progress flag

- Make checkout() and checkoutDetach() accept showProgress so callers
  can opt into --progress output; default remains --quiet
- Pass settings.showProgress to checkout() from git-source-provider
- Fix fetchOptions.showProgress not being set (was always undefined)
- Rebuild dist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Max schwenk 2026-02-25 18:24:10 -05:00
parent 153bc0ba7c
commit f3b6b37fa6
3 changed files with 19 additions and 12 deletions

13
dist/index.js vendored
View file

@ -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) {