Allow to fetch tags.

This commit is contained in:
Steven Van Ingelgem 2025-06-10 08:45:30 +02:00
parent df9ce67227
commit 6b47c9436e
2 changed files with 5 additions and 2 deletions

View File

@ -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',

4
dist/index.js vendored
View File

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