From 6b47c9436e478eec2220e61972b035623a83c11e Mon Sep 17 00:00:00 2001 From: Steven Van Ingelgem Date: Tue, 10 Jun 2025 08:45:30 +0200 Subject: [PATCH] Allow to fetch tags. --- __test__/git-command-manager.test.ts | 3 +++ dist/index.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/__test__/git-command-manager.test.ts b/__test__/git-command-manager.test.ts index cea73d4..9b12027 100644 --- a/__test__/git-command-manager.test.ts +++ b/__test__/git-command-manager.test.ts @@ -134,6 +134,7 @@ describe('Test fetchDepth and fetchTags options', () => { '-c', 'protocol.version=2', 'fetch', + '--tags', '--prune', '--no-recurse-submodules', '--filter=filterValue', @@ -248,6 +249,7 @@ describe('Test fetchDepth and fetchTags options', () => { '-c', 'protocol.version=2', 'fetch', + '--tags', '--prune', '--no-recurse-submodules', '--filter=filterValue', @@ -364,6 +366,7 @@ describe('Test fetchDepth and fetchTags options', () => { '-c', 'protocol.version=2', 'fetch', + '--tags', '--prune', '--no-recurse-submodules', '--progress', diff --git a/dist/index.js b/dist/index.js index b0db713..009a26b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -653,8 +653,8 @@ class GitCommandManager { fetch(refSpec, options) { return __awaiter(this, void 0, void 0, function* () { const args = ['-c', 'protocol.version=2', 'fetch']; - if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) { - args.push('--no-tags'); + if (!refSpec.some(x => x === refHelper.tagsRefSpec)) { + args.push(options.fetchTags ? '--tags' : '--no-tags'); } args.push('--prune', '--no-recurse-submodules'); if (options.showProgress) {