Skip to content

Commit b14b557

Browse files
bazel-iocgrindel
andauthored
[8.2.0] Do not require sparse checkout attrs (#25782)
Closes #25773. cc: @jpc-sf Closes #25774. PiperOrigin-RevId: 744751249 Change-Id: Idd9eaa5a524b86d2f357b311d92a586f4f0116ab Commit 441c563 Co-authored-by: Chuck Grindel <[email protected]>
1 parent be5574b commit b14b557

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/build_defs/repo/git_worker.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def add_origin(ctx, git_repo, remote):
158158
def fetch(ctx, git_repo):
159159
args = ["fetch", "origin", git_repo.fetch_ref]
160160

161-
sparse_checkout_patterns_or_file = ctx.attr.sparse_checkout_patterns or ctx.attr.sparse_checkout_file
161+
sparse_checkout_patterns_or_file = \
162+
getattr(ctx.attr, "sparse_checkout_patterns", None) or \
163+
getattr(ctx.attr, "sparse_checkout_file", None)
162164
if sparse_checkout_patterns_or_file:
163165
if _git_sparse_checkout_config(ctx, git_repo):
164166
# Use filter to disable downloading file contents until we set the `sparse-checkout` patterns.

0 commit comments

Comments
 (0)