Skip to content

Commit 2ec787b

Browse files
committed
cleanup path classificaiton after fixes in gix-pathspec
1 parent 5dea6f1 commit 2ec787b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

gix-dir/src/walk/classify.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ pub fn root(
2121
let mut path_buf = worktree_root.to_owned();
2222
// These initial values kick in if worktree_relative_root.is_empty();
2323
let file_kind = path_buf.symlink_metadata().map(|m| m.file_type().into()).ok();
24-
let pathspec_orig = std::mem::replace(
25-
ctx.pathspec,
26-
gix_pathspec::Search::from_specs(None, None, "".as_ref()).expect("empty is valid"),
27-
);
28-
let res = path(&mut path_buf, buf, 0, file_kind, || None, options, ctx);
29-
*ctx.pathspec = pathspec_orig;
30-
let mut out = res?;
24+
let mut out = path(&mut path_buf, buf, 0, file_kind, || None, options, ctx)?;
3125
let worktree_root_is_repository = out
3226
.disk_kind
3327
.map_or(false, |kind| matches!(kind, entry::Kind::Repository));
@@ -181,10 +175,9 @@ pub fn path(
181175
out.property = entry::Property::DotGit.into();
182176
return Ok(out);
183177
}
184-
let pathspec_could_match = rela_path.is_empty()
185-
|| ctx
186-
.pathspec
187-
.can_match_relative_path(rela_path.as_bstr(), disk_kind.map(|ft| ft.is_dir()));
178+
let pathspec_could_match = ctx
179+
.pathspec
180+
.can_match_relative_path(rela_path.as_bstr(), disk_kind.map(|ft| ft.is_dir()));
188181
if !pathspec_could_match {
189182
return Ok(out.with_status(entry::Status::Pruned));
190183
}

0 commit comments

Comments
 (0)