This commit is contained in:
parent
074097a8e7
commit
299b9d8883
|
@ -471,7 +471,7 @@ nextFile:
|
||||||
// map.
|
// map.
|
||||||
desired := fileDeletions[candidate.Name]
|
desired := fileDeletions[candidate.Name]
|
||||||
if err := f.renameFile(candidate, desired, fi, snap, dbUpdateChan, scanChan); err != nil {
|
if err := f.renameFile(candidate, desired, fi, snap, dbUpdateChan, scanChan); err != nil {
|
||||||
l.Debugln("rename shortcut for %s failed: %S", fi.Name, err.Error())
|
l.Debugf("rename shortcut for %s failed: %s", fi.Name, err.Error())
|
||||||
// Failed to rename, try next one.
|
// Failed to rename, try next one.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -720,8 +720,6 @@ func TestRequestRemoteRenameChanged(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var gotA, gotB, gotConfl bool
|
var gotA, gotB, gotConfl bool
|
||||||
bIntermediateVersion := protocol.Vector{}.Update(fc.id.Short()).Update(myID.Short())
|
|
||||||
bFinalVersion := bIntermediateVersion.Copy().Update(fc.id.Short())
|
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
fc.mut.Lock()
|
fc.mut.Lock()
|
||||||
fc.indexFn = func(_ context.Context, folder string, fs []protocol.FileInfo) {
|
fc.indexFn = func(_ context.Context, folder string, fs []protocol.FileInfo) {
|
||||||
|
@ -742,16 +740,12 @@ func TestRequestRemoteRenameChanged(t *testing.T) {
|
||||||
if gotB {
|
if gotB {
|
||||||
t.Error("Got more than one index update for", f.Name)
|
t.Error("Got more than one index update for", f.Name)
|
||||||
}
|
}
|
||||||
if f.Version.Equal(bIntermediateVersion) {
|
if f.Version.Counter(fc.id.Short()) == 0 {
|
||||||
// This index entry might be superseeded
|
// This index entry might be superseeded
|
||||||
// by the final one or sent before it separately.
|
// by the final one or sent before it separately.
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if f.Version.Equal(bFinalVersion) {
|
gotB = true
|
||||||
gotB = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
t.Errorf("Got unexpected version %v for file %v in index update", f.Version, f.Name)
|
|
||||||
case strings.HasPrefix(f.Name, "b.sync-conflict-"):
|
case strings.HasPrefix(f.Name, "b.sync-conflict-"):
|
||||||
if gotConfl {
|
if gotConfl {
|
||||||
t.Error("Got more than one index update for conflicts of", f.Name)
|
t.Error("Got more than one index update for conflicts of", f.Name)
|
||||||
|
|
Loading…
Reference in New Issue