@@ -21,13 +21,7 @@ pub fn root(
21
21
let mut path_buf = worktree_root. to_owned ( ) ;
22
22
// These initial values kick in if worktree_relative_root.is_empty();
23
23
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) ?;
31
25
let worktree_root_is_repository = out
32
26
. disk_kind
33
27
. map_or ( false , |kind| matches ! ( kind, entry:: Kind :: Repository ) ) ;
@@ -181,10 +175,9 @@ pub fn path(
181
175
out. property = entry:: Property :: DotGit . into ( ) ;
182
176
return Ok ( out) ;
183
177
}
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 ( ) ) ) ;
188
181
if !pathspec_could_match {
189
182
return Ok ( out. with_status ( entry:: Status :: Pruned ) ) ;
190
183
}
0 commit comments