Exclude locally ignored files from build archives - #4123
Open
Nezz wants to merge 1 commit into
Open
Conversation
The working directory copy that adds uncommitted and untracked files to the project archive filtered paths with a reimplementation of git's ignore rules that only read .gitignore files. Paths excluded through $GIT_DIR/info/exclude or core.excludesFile were therefore uploaded even though git reports them as ignored, which is impossible to spot because `git status` stays clean. Ask git for the ignored paths instead, so archiving is consistent with `isFileIgnoredAsync()`, which already uses `git check-ignore`. Tracked files that match an ignore rule are now included too, since git never reports them as ignored and the shallow clone is made with `--no-checkout`. Projects with an .easignore keep the existing behavior, where the file replaces git's ignore rules entirely.
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
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.
Why
Fixes #4122
How
GitClientnow asks git which paths are ignored instead of grabbing git's ignore rules from.gitignorefiles only. That covers$GIT_DIR/info/excludeandcore.excludesFile, and makes the copy consistent withisFileIgnoredAsync(), which already usedgit check-ignore. Projects with an.easignorekeep the existing behaviour.Test Plan
7 new tests, each failing on
main:info/exclude,core.excludesFile, ignores inside a submodule, and tracked files matching a.gitignorerule.yarn test,yarn typecheck,yarn lintandyarn fmt:checkare clean.Reproduces with
eas build:inspect -p ios -s archive -o /tmp/inspecton a blank project with a 100 MB directory listed in.git/info/exclude, wheregit statusstays clean: