@@ -408,12 +408,12 @@ impl<'index> State<'_, 'index> {
408
408
None => false ,
409
409
} ;
410
410
411
- // Here we implement racy-git. See racy-git.txt in the git documentation for a detailed documentation.
411
+ // We implement racy-git. See racy-git.txt in the git documentation for detailed documentation.
412
412
//
413
413
// A file is racy if:
414
- // 1. its `mtime` is at or after the last index timestamp and its entry stat information
415
- // matches the on-disk file but the file contents are actually modified
416
- // 2. it's size is 0 (set after detecting a file was racy previously)
414
+ // 1. Its `mtime` is at or after the last index timestamp and its entry stat information
415
+ // matches the on-disk file, but the file contents are actually modified
416
+ // 2. Its size is 0 (set after detecting a file was racy previously)
417
417
//
418
418
// The first case is detected below by checking the timestamp if the file is marked unmodified.
419
419
// The second case is usually detected either because the on-disk file is not empty, hence
@@ -449,7 +449,16 @@ impl<'index> State<'_, 'index> {
449
449
file_len : file_size_bytes,
450
450
filter : & mut self . filter ,
451
451
attr_stack : & mut self . attr_stack ,
452
- options : self . options ,
452
+ core_symlinks :
453
+ // If this is legitimately a symlink, then pretend symlinks are enabled as the option seems stale.
454
+ // Otherwise, respect the option.
455
+ if metadata. is_symlink ( )
456
+ && entry. mode . to_tree_entry_mode ( ) . map ( |m| m. kind ( ) ) == Some ( gix_object:: tree:: EntryKind :: Link )
457
+ {
458
+ true
459
+ } else {
460
+ self . options . fs . symlink
461
+ } ,
453
462
id : & entry. id ,
454
463
objects,
455
464
worktree_reads : self . worktree_reads ,
@@ -517,7 +526,7 @@ where
517
526
entry : & ' a gix_index:: Entry ,
518
527
filter : & ' a mut gix_filter:: Pipeline ,
519
528
attr_stack : & ' a mut gix_worktree:: Stack ,
520
- options : & ' a Options ,
529
+ core_symlinks : bool ,
521
530
id : & ' a gix_hash:: oid ,
522
531
objects : Find ,
523
532
worktree_bytes : & ' a AtomicU64 ,
@@ -545,7 +554,7 @@ where
545
554
//
546
555
let is_symlink = self . entry . mode == gix_index:: entry:: Mode :: SYMLINK ;
547
556
// TODO: what to do about precompose unicode and ignore_case for symlinks
548
- let out = if is_symlink && self . options . fs . symlink {
557
+ let out = if is_symlink && self . core_symlinks {
549
558
// conversion to bstr can never fail because symlinks are only used
550
559
// on unix (by git) so no reason to use the try version here
551
560
let symlink_path =
0 commit comments