@@ -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,
@@ -387,8 +387,11 @@ pub(super) mod function {
387
387
388
388
impl < T , U > gix_dir:: walk:: Delegate for Delegate < ' _ , ' _ , T , U > {
389
389
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
+ }
392
395
393
396
if self . should_interrupt . load ( Ordering :: Relaxed ) {
394
397
Action :: Cancel
@@ -466,6 +469,10 @@ pub(super) mod function {
466
469
ModificationOrDirwalkEntry :: Modification ( c) => c. entry . mode . to_tree_entry_mode ( ) ,
467
470
ModificationOrDirwalkEntry :: DirwalkEntry { entry, .. } => entry. disk_kind . map ( |kind| {
468
471
match kind {
472
+ Kind :: NonFile => {
473
+ // Trees are never tracked for rewrites, so we 'pretend'.
474
+ gix_object:: tree:: EntryKind :: Tree
475
+ }
469
476
Kind :: File => gix_object:: tree:: EntryKind :: Blob ,
470
477
Kind :: Symlink => gix_object:: tree:: EntryKind :: Link ,
471
478
Kind :: Repository | Kind :: Directory => gix_object:: tree:: EntryKind :: Tree ,
@@ -500,6 +507,10 @@ pub(super) mod function {
500
507
} ;
501
508
502
509
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
+ }
503
514
Kind :: File => {
504
515
let platform = attrs
505
516
. at_entry ( rela_path, None , objects)
0 commit comments