fix: suppress embedded-repo warning with advice config (#14)#57
Open
olavostauros wants to merge 1 commit into
Open
fix: suppress embedded-repo warning with advice config (#14)#57olavostauros wants to merge 1 commit into
olavostauros wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
modules addembedded-repo warning (#14) was caused bygit addof a clone directory in the old hash-based subdirectory layout (pre-opacity redesign).git addon a specific file like.modules/manifestcannot trigger this warning — git only emits it when adding a directory that contains a.gitsubdirectory, or duringgit add ./wildcard operations. The currentaddtask only stages.modules/manifest(no directory adds), andmodules/is gitignored bysetup, so the warning cannot reproduce with current code.This PR adds two layers of protection:
-c advice.addEmbeddedRepo=falseon thegit addcall in theaddtask — defense-in-depth that suppresses the advice at the source, even if a future refactor inadvertently reintroduces a directorygit add. The config key was introduced in git 2.35 (2022) and all supported platforms ship it; older gits silently ignore unknown-ckeys.Regression guard in
test/add.bats— asserts no "embedded git repository" substring appears inmodules addoutput.Closes #14.
Validation
mise run test— all 136 pass (including new guard)codebase lint "$PWD"— all 9 rules passreadme build --check— README is up to dategit diff --check— no whitespace issues