File tree 2 files changed +6
-2
lines changed
gitoxide-core/src/repository
gix-status/src/index_as_worktree_with_renames
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ pub(crate) mod function {
163
163
. join ( gix:: path:: from_bstr ( entry. rela_path . as_bstr ( ) ) )
164
164
. metadata ( )
165
165
. ok ( )
166
- . and_then ( |e| gix :: dir :: entry :: Kind :: try_from_file_type ( e. file_type ( ) ) ) ;
166
+ . map ( |e| e. file_type ( ) . into ( ) ) ;
167
167
}
168
168
let mut disk_kind = entry. disk_kind . expect ( "present if not pruned" ) ;
169
169
if !keep {
@@ -183,6 +183,7 @@ pub(crate) mod function {
183
183
}
184
184
185
185
match disk_kind {
186
+ Kind :: NonFile => unreachable ! ( "these are always considered pruned, and they were skipped earlier." ) ,
186
187
Kind :: File | Kind :: Symlink => { }
187
188
Kind :: Directory => {
188
189
if !directories {
@@ -254,6 +255,7 @@ pub(crate) mod function {
254
255
"WOULD remove"
255
256
} ,
256
257
suffix = match disk_kind {
258
+ Kind :: NonFile => unreachable!( "these are always considered pruned, and they were skipped earlier." ) ,
257
259
Kind :: Directory if entry. property == Some ( gix:: dir:: entry:: Property :: EmptyDirectory ) => {
258
260
" empty"
259
261
}
Original file line number Diff line number Diff line change @@ -466,6 +466,7 @@ pub(super) mod function {
466
466
ModificationOrDirwalkEntry :: Modification ( c) => c. entry . mode . to_tree_entry_mode ( ) ,
467
467
ModificationOrDirwalkEntry :: DirwalkEntry { entry, .. } => entry. disk_kind . map ( |kind| {
468
468
match kind {
469
+ Kind :: NonFile => unreachable ! ( "we rejected non-file entries earlier" ) ,
469
470
Kind :: File => gix_object:: tree:: EntryKind :: Blob ,
470
471
Kind :: Symlink => gix_object:: tree:: EntryKind :: Link ,
471
472
Kind :: Repository | Kind :: Directory => gix_object:: tree:: EntryKind :: Tree ,
@@ -495,11 +496,12 @@ pub(super) mod function {
495
496
buf : & mut Vec < u8 > ,
496
497
should_interrupt : & std:: sync:: atomic:: AtomicBool ,
497
498
) -> Result < gix_hash:: ObjectId , Error > {
498
- let Some ( kind) = disk_kind else {
499
+ let Some ( kind) = disk_kind. filter ( |kind| ! matches ! ( kind , Kind :: NonFile ) ) else {
499
500
return Ok ( object_hash. null ( ) ) ;
500
501
} ;
501
502
502
503
Ok ( match kind {
504
+ Kind :: NonFile => unreachable ! ( "rejected earlier" ) ,
503
505
Kind :: File => {
504
506
let platform = attrs
505
507
. at_entry ( rela_path, None , objects)
You can’t perform that action at this time.
0 commit comments