Skip to content

Commit 41e1ac2

Browse files
Fix Windows by using dunce
1 parent fdcd3d5 commit 41e1ac2

File tree

5 files changed

+9
-56
lines changed

5 files changed

+9
-56
lines changed

Cargo.lock

Lines changed: 5 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ignore/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ bench = false
2020

2121
[dependencies]
2222
crossbeam-deque = "0.8.3"
23-
globset = { path = "../globset" }
23+
globset = "0.4.16"
2424
log = "0.4.20"
2525
memchr = "2.6.3"
2626
same-file = "1.0.6"
2727
walkdir = "2.4.0"
28+
dunce = "1.0.5"
2829

2930
[dependencies.regex-automata]
3031
version = "0.4.0"

crates/ignore/src/dir.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ impl Ignore {
176176
if !self.is_root() {
177177
panic!("Ignore::add_parents called on non-root matcher");
178178
}
179-
let absolute_base = match path.as_ref().canonicalize() {
179+
// CHANGED: Use `dunce::canonicalize` as we use it everywhere else.
180+
let absolute_base = match dunce::canonicalize(path.as_ref()) {
180181
Ok(path) => Arc::new(path),
181182
Err(_) => {
182183
// There's not much we can do here, so just return our
@@ -504,8 +505,6 @@ impl Ignore {
504505
&m_explicit,
505506
];
506507

507-
dbg!(path.to_string_lossy(), order);
508-
509508
for (idx, check) in order.into_iter().enumerate() {
510509
if check.is_none() {
511510
continue;

crates/ignore/src/gitignore.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ impl Gitignore {
184184
/// gitignore) is stripped. If there is no common suffix/prefix overlap,
185185
/// then `path` is assumed to be relative to this matcher.
186186
pub fn matched<P: AsRef<Path>>(&self, path: P, is_dir: bool) -> Match<&Glob> {
187-
dbg!(path.as_ref(), &self.globs);
188187
if self.is_empty() {
189188
return Match::None;
190189
}
@@ -247,7 +246,6 @@ impl Gitignore {
247246
self.set.matches_candidate_into(&candidate, &mut *matches);
248247
for &i in matches.iter().rev() {
249248
let glob = &self.globs[i];
250-
dbg!(&glob);
251249
if !glob.is_only_dir() || is_dir {
252250
return if glob.is_whitelist() {
253251
Match::Whitelist(glob)
@@ -278,7 +276,6 @@ impl Gitignore {
278276
// As an additional special case, if the root is just `.`, then we
279277
// shouldn't try to strip anything, e.g., when path begins with a `.`.
280278
if self.root != Path::new(".") && !is_file_name(path) {
281-
dbg!(&self.root, &path);
282279
if let Some(p) = strip_prefix(&self.root, path) {
283280
path = p;
284281
// If we're left with a leading slash, get rid of it.

crates/oxide/src/scanner/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ impl Scanner {
100100
pub fn new(sources: Vec<PublicSourceEntry>) -> Self {
101101
let sources = Sources::new(public_source_entries_to_private_source_entries(sources));
102102

103-
dbg!(&sources);
104-
105103
Self {
106104
sources: sources.clone(),
107105
walker: create_walker(sources),

0 commit comments

Comments
 (0)