Skip to content

Commit 2891112

Browse files
committed
fix(run-task): don't fetch tags if target ref starts with 'refs/heads'
1 parent 3c5b604 commit 2891112

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/taskgraph/run-task/run-task

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,9 @@ def git_checkout(
692692
# because it is the only scenario where tags could be present. (PRs, for
693693
# example, always include an explicit rev.) Failure to do this could result
694694
# in not having a tag, or worse: having an outdated version of one.
695-
tags = True if head_ref and base_repo == head_repo else False
695+
tags = False
696+
if head_ref and not head_ref.startswith("refs/heads/") and base_repo == head_repo:
697+
tags = True
696698

697699
# If a head_ref isn't provided, we fetch all refs from head_repo, which may be slow.
698700
target = head_ref if head_ref else "+refs/heads/*:refs/remotes/work/*"

0 commit comments

Comments
 (0)