Only run rename detection for new files. This skips an expensive check for all updates to existing files. The tradeoff is that we no longer immediately detect renames on top of another file as a rename -- this may instead become a copy+delete operation on the destination. --------- Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -146,6 +146,8 @@ type FileInfo struct {
|
||||
Deleted bool
|
||||
NoPermissions bool
|
||||
|
||||
New bool // set by the scanner when the file newly appeared on disk; no db / wire representation
|
||||
|
||||
truncated bool // was created from a truncated file info without blocks
|
||||
}
|
||||
|
||||
@@ -233,7 +235,8 @@ func (f *FileInfo) LogAttr() slog.Attr {
|
||||
case FileInfoTypeFile:
|
||||
kind = "file"
|
||||
if !f.Deleted {
|
||||
attrs = append(attrs,
|
||||
attrs = append(
|
||||
attrs,
|
||||
slog.Any("modified", f.ModTime()),
|
||||
slog.String("permissions", fmt.Sprintf("0%03o", f.Permissions)),
|
||||
slog.Int64("size", f.Size),
|
||||
|
||||
Reference in New Issue
Block a user