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:
@@ -471,6 +471,8 @@ func (w *walker) walkRegular(ctx context.Context, relPath string, info fs.FileIn
|
||||
f.RawBlockSize = int32(blockSize)
|
||||
l.Debugln(w, "checking:", f)
|
||||
|
||||
f.New = !hasCurFile
|
||||
|
||||
if hasCurFile {
|
||||
if curFile.IsEquivalentOptional(f, protocol.FileInfoComparison{
|
||||
ModTimeWindow: w.ModTimeWindow,
|
||||
@@ -518,6 +520,8 @@ func (w *walker) walkDir(ctx context.Context, relPath string, info fs.FileInfo,
|
||||
f.NoPermissions = w.IgnorePerms
|
||||
l.Debugln(w, "checking:", f)
|
||||
|
||||
f.New = !hasCurFile
|
||||
|
||||
if hasCurFile {
|
||||
if curFile.IsEquivalentOptional(f, protocol.FileInfoComparison{
|
||||
ModTimeWindow: w.ModTimeWindow,
|
||||
@@ -570,6 +574,8 @@ func (w *walker) walkSymlink(ctx context.Context, relPath string, info fs.FileIn
|
||||
f = w.updateFileInfo(f, curFile)
|
||||
l.Debugln(w, "checking:", f)
|
||||
|
||||
f.New = !hasCurFile
|
||||
|
||||
if hasCurFile {
|
||||
if curFile.IsEquivalentOptional(f, protocol.FileInfoComparison{
|
||||
ModTimeWindow: w.ModTimeWindow,
|
||||
|
||||
Reference in New Issue
Block a user