Skip to content

fix: suppress embedded-repo warning with advice config (#14)#57

Open
olavostauros wants to merge 1 commit into
KnickKnackLabs:mainfrom
olavostauros:fix/closes-14-embedded-repo-warning
Open

fix: suppress embedded-repo warning with advice config (#14)#57
olavostauros wants to merge 1 commit into
KnickKnackLabs:mainfrom
olavostauros:fix/closes-14-embedded-repo-warning

Conversation

@olavostauros

Copy link
Copy Markdown
Contributor

Summary

The modules add embedded-repo warning (#14) was caused by git add of a clone directory in the old hash-based subdirectory layout (pre-opacity redesign). git add on a specific file like .modules/manifest cannot trigger this warning — git only emits it when adding a directory that contains a .git subdirectory, or during git add ./wildcard operations. The current add task only stages .modules/manifest (no directory adds), and modules/ is gitignored by setup, so the warning cannot reproduce with current code.

This PR adds two layers of protection:

  1. -c advice.addEmbeddedRepo=false on the git add call in the add task — defense-in-depth that suppresses the advice at the source, even if a future refactor inadvertently reintroduces a directory git add. The config key was introduced in git 2.35 (2022) and all supported platforms ship it; older gits silently ignore unknown -c keys.

  2. Regression guard in test/add.bats — asserts no "embedded git repository" substring appears in modules add output.

Closes #14.

Validation

  • mise run test — all 136 pass (including new guard)
  • codebase lint "$PWD" — all 9 rules pass
  • readme build --check — README is up to date
  • git diff --check — no whitespace issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

modules add warning

1 participant