@@ -158,7 +158,7 @@ pub(super) mod function {
158
158
159
159
let tracker = options
160
160
. rewrites
161
- . map ( gix_diff:: rewrites:: Tracker :: < rewrite :: ModificationOrDirwalkEntry < ' index , T , U > > :: new)
161
+ . map ( gix_diff:: rewrites:: Tracker :: < ModificationOrDirwalkEntry < ' index , T , U > > :: new)
162
162
. zip ( filter) ;
163
163
let rewrite_outcome = match tracker {
164
164
Some ( ( mut tracker, ( mut filter, mut attrs) ) ) => {
@@ -168,12 +168,12 @@ pub(super) mod function {
168
168
let ( change, location) = match event {
169
169
Event :: IndexEntry ( record) => {
170
170
let location = Cow :: Borrowed ( record. relative_path ) ;
171
- ( rewrite :: ModificationOrDirwalkEntry :: Modification ( record) , location)
171
+ ( ModificationOrDirwalkEntry :: Modification ( record) , location)
172
172
}
173
173
Event :: DirEntry ( entry, collapsed_directory_status) => {
174
174
let location = Cow :: Owned ( entry. rela_path . clone ( ) ) ;
175
175
(
176
- rewrite :: ModificationOrDirwalkEntry :: DirwalkEntry {
176
+ ModificationOrDirwalkEntry :: DirwalkEntry {
177
177
id : rewrite:: calculate_worktree_id (
178
178
options. object_hash ,
179
179
worktree,
@@ -222,7 +222,7 @@ pub(super) mod function {
222
222
}
223
223
}
224
224
Some ( src) => {
225
- let rewrite :: ModificationOrDirwalkEntry :: DirwalkEntry {
225
+ let ModificationOrDirwalkEntry :: DirwalkEntry {
226
226
id,
227
227
entry,
228
228
collapsed_directory_status,
@@ -466,6 +466,10 @@ 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 => {
470
+ // Trees are never tracked for rewrites, so we 'pretend'.
471
+ gix_object:: tree:: EntryKind :: Tree
472
+ }
469
473
Kind :: File => gix_object:: tree:: EntryKind :: Blob ,
470
474
Kind :: Symlink => gix_object:: tree:: EntryKind :: Link ,
471
475
Kind :: Repository | Kind :: Directory => gix_object:: tree:: EntryKind :: Tree ,
@@ -500,6 +504,10 @@ pub(super) mod function {
500
504
} ;
501
505
502
506
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
+ }
503
511
Kind :: File => {
504
512
let platform = attrs
505
513
. at_entry ( rela_path, None , objects)
0 commit comments