From e463b2c101b8e47cf5d044abd6062682bd53d355 Mon Sep 17 00:00:00 2001 From: Rodrigo Chacon <321351+rochacon@users.noreply.github.com> Date: Fri, 7 Mar 2025 14:05:11 -0300 Subject: [PATCH] fix fetch-tags when fetch-depth > 0 --- __test__/git-command-manager.test.ts | 1 + src/git-command-manager.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/__test__/git-command-manager.test.ts b/__test__/git-command-manager.test.ts index cea73d4..2fa758e 100644 --- a/__test__/git-command-manager.test.ts +++ b/__test__/git-command-manager.test.ts @@ -248,6 +248,7 @@ describe('Test fetchDepth and fetchTags options', () => { '-c', 'protocol.version=2', 'fetch', + '--tags', '--prune', '--no-recurse-submodules', '--filter=filterValue', diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 8e42a38..a840e20 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -263,6 +263,8 @@ class GitCommandManager { const args = ['-c', 'protocol.version=2', 'fetch'] if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) { args.push('--no-tags') + } else { + args.push('--tags') } args.push('--prune', '--no-recurse-submodules')