Repository navigation
Respect git global ignore files (core.excludesFile) in source scanner #20524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4f875f5
8e1e925
39cbde6
172a4c0
698aef3
5fc381d
147407c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -781,8 +781,8 @@ fn create_walker(sources: &Sources) -> Option<WalkBuilder> { | |
| // Scan hidden files / directories | ||
| builder.hidden(false); | ||
|
|
||
| // Don't respect global gitignore files | ||
| builder.git_global(false); | ||
| // Respect global gitignore files configured in git (e.g. `core.excludesFile`) | ||
| builder.git_global(true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Global ignore patterns containing Build the global matcher relative to each repository root rather than the process working directory. |
||
|
|
||
| // By default, allow .gitignore files to be used regardless of whether or not | ||
| // a .git directory is present. This is an optimization for when projects | ||
|
|
@@ -822,6 +822,7 @@ fn create_walker(sources: &Sources) -> Option<WalkBuilder> { | |
| for parent in first_root?.ancestors() { | ||
| if parent.join(".git").exists() { | ||
| builder.require_git(true); | ||
| builder.current_dir(parent); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.