"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
bisync: fix --conflict-resolve comparing a zero size or modtime
nielash1fd50dae9ca6
diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.goindex c9ab491c5..aecdacb16 100644--- a/cmd/bisync/deltas.go+++ b/cmd/bisync/deltas.go@@ -182,9 +182,6 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string,for _, file := range old.list {// REMEMBER: this section is only concerned with comparing listings from the same side (not different sides)d := deltaZero- s := int64(0)- h := ""- var t time.Timeif !now.has(file) {b.indent(msg, file, Color(terminal.RedFg, "File was deleted"))ds.deleted++@@ -202,7 +199,6 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string,whatchanged = append(whatchanged, Color(terminal.MagentaFg, "size (smaller)"))d |= deltaSmaller}- s = now.getSize(file)}}if b.opt.Compare.Modtime {@@ -216,7 +212,6 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string,whatchanged = append(whatchanged, Color(terminal.MagentaFg, "time (older)"))d |= deltaOlder}- t = now.getTime(file)}}if b.opt.Compare.Checksum {@@ -224,7 +219,6 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string,fs.Debugf(file, "(old: %v current: %v)", old.getHash(file), now.getHash(file))whatchanged = append(whatchanged, Color(terminal.MagentaFg, "hash"))d |= deltaHash- h = now.getHash(file)}}// concat changes and print log@@ -237,13 +231,13 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string,if d.is(deltaModified) {ds.deltas[file] = dif b.opt.Compare.Size {- ds.size[file] = s+ ds.size[file] = now.getSize(file)}if b.opt.Compare.Modtime {- ds.time[file] = t+ ds.time[file] = now.getTime(file)}if b.opt.Compare.Checksum {- ds.hash[file] = h+ ds.hash[file] = now.getHash(file)}} else if d.is(deltaDeleted) {ds.deltas[file] = ddiff --git a/cmd/bisync/testdata/test_resolve/golden/test.log b/cmd/bisync/testdata/test_resolve/golden/test.logindex 8aaf9a751..3fe99dfc7 100644--- a/cmd/bisync/testdata/test_resolve/golden/test.log+++ b/cmd/bisync/testdata/test_resolve/golden/test.log@@ -151,7 +151,7 @@ NOTICE: {path2String}: 1 differences foundNOTICE: {path2String}: 1 errors while checkingINFO : Finished checking the potential conflicts. 1 differences foundNOTICE: - [34mWARNING[0m [35mNew or changed in both paths[0m - [36mfile1.txt[0m-INFO : file1.txt: Winner cannot be determined as sizes are equal. Path1: 0, Path2: 0, Difference: 0+INFO : file1.txt: Winner cannot be determined as sizes are equal. Path1: 33, Path2: 33, Difference: 0INFO : file1.txt: [31mA winner could not be determined.[0mNOTICE: - [36mPath1[0m [35mRenaming Path1 copy[0m - [36m{path1/}file1.txt.apple1[0mNOTICE: - [36mPath1[0m [35m[32mQueue copy to[0m Path2[0m - [36m{path2/}file1.txt.apple1[0mdiff --git a/docs/content/bisync.md b/docs/content/bisync.mdindex 6d3f42a0a..99fd7932a 100644--- a/docs/content/bisync.md+++ b/docs/content/bisync.md@@ -1939,6 +1939,7 @@ about *Unison* and synchronization in general.the `--max-delete` safety check when used with `--track-renames`.- Fixed an issue causing the conflict winner to be missing from listings whenPath2 won.+- Fixed an issue causing `--conflict-resolve` to compare a zero size or modtime.### `v1.74.2`