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 a251a19..041837e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -828,6 +828,9 @@ class GitCommandManager { if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) { args.push('--no-tags'); } + else if (options.fetchTags) { + args.push('--tags'); + } args.push('--prune', '--no-recurse-submodules'); if (options.showProgress) { args.push('--progress'); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index a45e15a..102f390 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -287,6 +287,8 @@ class GitCommandManager { const args = ['-c', 'protocol.version=2', 'fetch'] if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) { args.push('--no-tags') + } else if (options.fetchTags) { + args.push('--tags') } args.push('--prune', '--no-recurse-submodules')