Skip to content

Commit 4450da7

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

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
@@ -670,7 +670,9 @@ def git_checkout(
670670
# because it is the only scenario where tags could be present. (PRs, for
671671
# example, always include an explicit rev.) Failure to do this could result
672672
# in not having a tag, or worse: having an outdated version of one.
673-
tags = True if ref and base_repo == head_repo else False
673+
tags = False
674+
if ref and not ref.startswith("refs/heads/") and base_repo == head_repo:
675+
tags = True
674676

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

0 commit comments

Comments
 (0)