Skip to content

#1467 fix fetchTags=true do not fetch tags #2127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#1467 fix fetchTags=true do not fetch tags
  • Loading branch information
aless10 committed Apr 5, 2025
commit de1c608fff59cd28efd1f02c9211a6631fec5062
3 changes: 3 additions & 0 deletions __test__/git-command-manager.test.ts
Original file line number Diff line number Diff line change
@@ -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',
2 changes: 2 additions & 0 deletions src/git-command-manager.ts
Original file line number Diff line number Diff line change
@@ -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 if (options.fetchTags) {
args.push('--tags')
}

args.push('--prune', '--no-recurse-submodules')