@@ -158,7 +158,7 @@ pub(super) mod function {
158158
159159 let tracker = options
160160 . rewrites
161- . map ( gix_diff:: rewrites:: Tracker :: < rewrite :: ModificationOrDirwalkEntry < ' index , T , U > > :: new)
161+ . map ( gix_diff:: rewrites:: Tracker :: < ModificationOrDirwalkEntry < ' index , T , U > > :: new)
162162 . zip ( filter) ;
163163 let rewrite_outcome = match tracker {
164164 Some ( ( mut tracker, ( mut filter, mut attrs) ) ) => {
@@ -168,12 +168,12 @@ pub(super) mod function {
168168 let ( change, location) = match event {
169169 Event :: IndexEntry ( record) => {
170170 let location = Cow :: Borrowed ( record. relative_path ) ;
171- ( rewrite :: ModificationOrDirwalkEntry :: Modification ( record) , location)
171+ ( ModificationOrDirwalkEntry :: Modification ( record) , location)
172172 }
173173 Event :: DirEntry ( entry, collapsed_directory_status) => {
174174 let location = Cow :: Owned ( entry. rela_path . clone ( ) ) ;
175175 (
176- rewrite :: ModificationOrDirwalkEntry :: DirwalkEntry {
176+ ModificationOrDirwalkEntry :: DirwalkEntry {
177177 id : rewrite:: calculate_worktree_id (
178178 options. object_hash ,
179179 worktree,
@@ -222,7 +222,7 @@ pub(super) mod function {
222222 }
223223 }
224224 Some ( src) => {
225- let rewrite :: ModificationOrDirwalkEntry :: DirwalkEntry {
225+ let ModificationOrDirwalkEntry :: DirwalkEntry {
226226 id,
227227 entry,
228228 collapsed_directory_status,
@@ -387,8 +387,11 @@ pub(super) mod function {
387387
388388 impl < T , U > gix_dir:: walk:: Delegate for Delegate < ' _ , ' _ , T , U > {
389389 fn emit ( & mut self , entry : EntryRef < ' _ > , collapsed_directory_status : Option < Status > ) -> Action {
390- let entry = entry. to_owned ( ) ;
391- self . tx . send ( Event :: DirEntry ( entry, collapsed_directory_status) ) . ok ( ) ;
390+ // Status never shows untracked non-files
391+ if entry. disk_kind != Some ( gix_dir:: entry:: Kind :: NonFile ) {
392+ let entry = entry. to_owned ( ) ;
393+ self . tx . send ( Event :: DirEntry ( entry, collapsed_directory_status) ) . ok ( ) ;
394+ }
392395
393396 if self . should_interrupt . load ( Ordering :: Relaxed ) {
394397 Action :: Cancel
@@ -466,6 +469,10 @@ pub(super) mod function {
466469 ModificationOrDirwalkEntry :: Modification ( c) => c. entry . mode . to_tree_entry_mode ( ) ,
467470 ModificationOrDirwalkEntry :: DirwalkEntry { entry, .. } => entry. disk_kind . map ( |kind| {
468471 match kind {
472+ Kind :: NonFile => {
473+ // Trees are never tracked for rewrites, so we 'pretend'.
474+ gix_object:: tree:: EntryKind :: Tree
475+ }
469476 Kind :: File => gix_object:: tree:: EntryKind :: Blob ,
470477 Kind :: Symlink => gix_object:: tree:: EntryKind :: Link ,
471478 Kind :: Repository | Kind :: Directory => gix_object:: tree:: EntryKind :: Tree ,
@@ -500,6 +507,10 @@ pub(super) mod function {
500507 } ;
501508
502509 Ok ( match kind {
510+ Kind :: NonFile => {
511+ // Go along with unreadable files, they are passed along without rename tracking.
512+ return Ok ( object_hash. null ( ) ) ;
513+ }
503514 Kind :: File => {
504515 let platform = attrs
505516 . at_entry ( rela_path, None , objects)
0 commit comments