Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(cli): use matched_path_or_any_parents when checking if a file is ignored #8903

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': patch:bug
'@tauri-apps/cli': patch:bug
---

Fix `.taurignore` failing to ignore in some cases.
6 changes: 5 additions & 1 deletion tooling/cli/src/interface/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ struct IgnoreMatcher(Vec<Gitignore>);
impl IgnoreMatcher {
fn is_ignore(&self, path: &Path, is_dir: bool) -> bool {
for gitignore in &self.0 {
if gitignore.matched(path, is_dir).is_ignore() {
if path.starts_with(gitignore.path())
&& gitignore
.matched_path_or_any_parents(path, is_dir)
.is_ignore()
{
return true;
}
}
Expand Down
Loading