Skip to content

Commit

Permalink
fetch tags when fetch-depth > 0. fix actions#1781
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau authored Jan 14, 2025
1 parent cbb7224 commit 0776c3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/git-command-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@ class GitCommandManager {
}
): Promise<void> {
const args = ['-c', 'protocol.version=2', 'fetch']
if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
args.push('--no-tags')
if (options.fetchTags) {
args.push('--tags')
} else {
if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
args.push('--no-tags')
}
}

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

0 comments on commit 0776c3a

Please sign in to comment.