Keep a submodule's own .git/config out of the build context (closes #88)
check / check (push) Failing after 1s

The canonical .dockerignore kept out .git/config and the configs under
.git/modules/, but not the config of a submodule that keeps its own .git
directory, so its credential reached the image. Both git patterns now
carry the **/ prefix.

A submodule named config or deploy/config still loses its whole git
directory, and Go's version stamping fails the build. Closing that needs
a wildcard re-include, which makes BuildKit walk every excluded directory
on every build, so the file records it as a KNOWN GAP with the remedy,
git submodule add --name. REPO_POLICIES.md and both checklists say the
same.

Model: opus-5-5
This commit is contained in:
2026-10-04 08:30:37 +00:00
parent c43c1f4bca
commit 73bbe8f736
5 changed files with 78 additions and 51 deletions
+8 -3
View File
@@ -18,9 +18,14 @@
# does not need .git/config; that file can hold a credential, such as a
# password in a remote URL or the token the CI checkout step stores there.
# Each submodule keeps a config with the same exposure in its git directory
# under .git/modules/, nested again for a submodule's own submodules.
.git/config
.git/modules/**/config
# under .git/modules/, nested again for a submodule's own submodules, or in
# its own .git directory when it keeps one.
# KNOWN GAP: `**/.git/modules/**/config` also matches the git directory
# of a submodule named `config` or `deploy/config`, so all of it stays
# out and Go's version stamping fails the build; nothing leaks. Name
# such a submodule without that segment: `git submodule add --name`.
**/.git/config
**/.git/modules/**/config
# Agent scratch: one full checkout of the repo per in-flight agent.
# Anchored because it occurs once where agents run at the repo root.