Skip to content

Commit 6e3402f

Browse files
OSS-Fuzz Teamcopybara-github
authored andcommitted
Snapshotting: Skip .git directories and files
`.git` can be a directory (in the normal case) or a file (if it is in a git worktree). We should not include it, because it can become very large. PiperOrigin-RevId: 821615296
1 parent 55d46fe commit 6e3402f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

infra/base-images/base-builder/indexer/manifest_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ def _save_dir(
432432
# Don't copy over the seed corpus -- it's not necessary.
433433
continue
434434

435+
if "/.git/" in root or root.endswith("/.git"):
436+
# Skip the .git directory -- it can be large.
437+
continue
438+
435439
file = pathlib.Path(root, file)
436440
if exclude_build_artifacts and _is_elf(file):
437441
continue

0 commit comments

Comments
 (0)