-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(git): fix
exclude
files handling in subtree
Git repo scan mode (
#5504) * refactor(test): own test helpers for different test contexts * test(git): extra test case Full (prefix and postfix) glob pattern for exclude filter * test(git): split single context into 2 separate ones * refactor: test helpers for deep nested dirs in exclude filter test * test(git): reproducible failure example * fix(git): handle directory exclusions properly Normalize the excluded relative paths with redundant `..` and `.` parts. This ensures that `--glob-pathspecs` Git flag will behave properly with `--exclude` arg. This fix prevent rebuilding container module on excluded files modification. * chore: extract some local vars for better readability and easier debugging * test: enable fixed tests and mute the known failures * refactor(git): move include/exclude files processing to a dedicated function * improvement(git): always use normalized exclude paths in `subtree` scan mode * improvement(git): always use normalized exclude paths in `repo` scan mode * refactor: simplify re-init of exclude filter * chore: more explanation on the implemented fix * chore: re-arranged code First, process inclusions, and then exclusions. For more clarity and consistency in the comments. * chore: cosmetic amendments in the comments
- Loading branch information
1 parent
61eac76
commit 358aeab
Showing
7 changed files
with
231 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
core/test/data/test-projects/include-exclude/module-b/dir1/foo.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm in the excluded dir. I should be excluded too. |
1 change: 1 addition & 0 deletions
1
core/test/data/test-projects/include-exclude/module-b/dir2/bar.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm in the excluded dir. I should be excluded. |
3 changes: 2 additions & 1 deletion
3
core/test/data/test-projects/include-exclude/module-b/garden.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
kind: Module | ||
name: module-b | ||
type: test | ||
exclude: ["nope.*"] | ||
# test both dir name and relative path | ||
exclude: ["nope.*", "./dir1", "dir2"] |
Oops, something went wrong.