@@ -66,10 +66,10 @@ pub(crate) mod function {
66
66
match skip_hidden_repositories {
67
67
Some ( FindRepository :: NonBare ) => Some ( FindNonBareRepositoriesInIgnoredDirectories ) ,
68
68
Some ( FindRepository :: All ) => Some ( FindRepositoriesInIgnoredDirectories ) ,
69
- None => None ,
69
+ None => Some ( Default :: default ( ) ) ,
70
70
}
71
71
} else {
72
- Some ( IgnoredDirectoriesCanHideNestedRepositories )
72
+ Some ( Default :: default ( ) )
73
73
} )
74
74
. classify_untracked_bare_repositories ( matches ! ( find_untracked_repositories, FindRepository :: All ) )
75
75
. emit_untracked ( collapse_directories)
@@ -88,7 +88,7 @@ pub(crate) mod function {
88
88
let mut pruned_entries = 0 ;
89
89
let mut saw_ignored_directory = false ;
90
90
let mut saw_untracked_directory = false ;
91
- for ( entry, dir_status) in entries. into_iter ( ) {
91
+ for ( mut entry, dir_status) in entries. into_iter ( ) {
92
92
if dir_status. is_some ( ) {
93
93
if debug {
94
94
writeln ! (
@@ -106,16 +106,15 @@ pub(crate) mod function {
106
106
. map_or ( false , |m| m != gix:: dir:: entry:: PathspecMatch :: Excluded ) ;
107
107
pruned_entries += usize:: from ( !pathspec_includes_entry) ;
108
108
if !pathspec_includes_entry && debug {
109
- writeln ! ( err, "DBG: prune '{}' as it is excluded by pathspec " , entry. rela_path) . ok ( ) ;
109
+ writeln ! ( err, "DBG: prune '{}'" , entry. rela_path) . ok ( ) ;
110
110
}
111
111
if entry. status . is_pruned ( ) || !pathspec_includes_entry {
112
112
continue ;
113
113
}
114
114
115
- let mut disk_kind = entry. disk_kind . expect ( "present if not pruned" ) ;
116
115
let keep = match entry. status {
117
- Status :: DotGit | Status :: Pruned | Status :: TrackedExcluded => {
118
- unreachable ! ( "BUG: Pruned are skipped already as their pathspec is always None " )
116
+ Status :: Pruned => {
117
+ unreachable ! ( "BUG: assumption that pruned entries have no pathspec match, but probably not " )
119
118
}
120
119
Status :: Tracked => {
121
120
unreachable ! ( "BUG: tracked aren't emitted" )
@@ -130,6 +129,14 @@ pub(crate) mod function {
130
129
}
131
130
Status :: Untracked => true ,
132
131
} ;
132
+ if entry. disk_kind . is_none ( ) {
133
+ entry. disk_kind = workdir
134
+ . join ( gix:: path:: from_bstr ( entry. rela_path . as_bstr ( ) ) )
135
+ . metadata ( )
136
+ . ok ( )
137
+ . map ( |e| e. file_type ( ) . into ( ) ) ;
138
+ }
139
+ let mut disk_kind = entry. disk_kind . expect ( "present if not pruned" ) ;
133
140
if !keep {
134
141
if debug {
135
142
writeln ! ( err, "DBG: prune '{}' as -x or -p is missing" , entry. rela_path) . ok ( ) ;
@@ -148,7 +155,7 @@ pub(crate) mod function {
148
155
149
156
match disk_kind {
150
157
Kind :: File | Kind :: Symlink => { }
151
- Kind :: EmptyDirectory | Kind :: Directory => {
158
+ Kind :: Directory => {
152
159
if !directories {
153
160
skipped_directories += 1 ;
154
161
if debug {
@@ -202,15 +209,15 @@ pub(crate) mod function {
202
209
} ,
203
210
maybe = if execute { "removing" } else { "WOULD remove" } ,
204
211
suffix = match disk_kind {
205
- Kind :: File | Kind :: Symlink | Kind :: Directory => {
206
- ""
207
- }
208
- Kind :: EmptyDirectory => {
212
+ Kind :: Directory if entry. flags. contains( gix:: dir:: entry:: Flags :: EMPTY_DIRECTORY ) => {
209
213
" empty"
210
214
}
211
215
Kind :: Repository => {
212
216
" repository"
213
217
}
218
+ Kind :: File | Kind :: Symlink | Kind :: Directory => {
219
+ ""
220
+ }
214
221
} ,
215
222
) ?;
216
223
@@ -256,7 +263,7 @@ pub(crate) mod function {
256
263
} ) ) ;
257
264
messages. extend ( ( pruned_entries > 0 && has_patterns) . then ( || {
258
265
format ! (
259
- "try to adjust your pathspec to reveal some of the {pruned_entries} pruned {entries}" ,
266
+ "try to adjust your pathspec to reveal some of the {pruned_entries} pruned {entries} - show with --debug " ,
260
267
entries = plural( "entry" , "entries" , pruned_entries)
261
268
)
262
269
} ) ) ;
0 commit comments