@@ -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,
@@ -466,6 +466,10 @@ pub(super) mod function {
466466 ModificationOrDirwalkEntry :: Modification ( c) => c. entry . mode . to_tree_entry_mode ( ) ,
467467 ModificationOrDirwalkEntry :: DirwalkEntry { entry, .. } => entry. disk_kind . map ( |kind| {
468468 match kind {
469+ Kind :: NonFile => {
470+ // Trees are never tracked for rewrites, so we 'pretend'.
471+ gix_object:: tree:: EntryKind :: Tree
472+ }
469473 Kind :: File => gix_object:: tree:: EntryKind :: Blob ,
470474 Kind :: Symlink => gix_object:: tree:: EntryKind :: Link ,
471475 Kind :: Repository | Kind :: Directory => gix_object:: tree:: EntryKind :: Tree ,
@@ -500,6 +504,10 @@ pub(super) mod function {
500504 } ;
501505
502506 Ok ( match kind {
507+ Kind :: NonFile => {
508+ // Go along with unreadable files, they are passed along without rename tracking.
509+ return Ok ( object_hash. null ( ) ) ;
510+ }
503511 Kind :: File => {
504512 let platform = attrs
505513 . at_entry ( rela_path, None , objects)
0 commit comments