mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Merge pull request #2655 from calmh/fix2605
Don't conflict copy conflict copies (fixes #2605)
This commit is contained in:
commit
504ad86648
@ -14,6 +14,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/syncthing/syncthing/lib/config"
|
"github.com/syncthing/syncthing/lib/config"
|
||||||
@ -1493,6 +1494,14 @@ func removeDevice(devices []protocol.DeviceID, device protocol.DeviceID) []proto
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *rwFolder) moveForConflict(name string) error {
|
func (p *rwFolder) moveForConflict(name string) error {
|
||||||
|
if strings.Contains(filepath.Base(name), ".sync-conflict-") {
|
||||||
|
l.Infoln("Conflict for", name, "which is already a conflict copy; not copying again.")
|
||||||
|
if err := osutil.Remove(name); err != nil && !os.IsNotExist(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if p.maxConflicts == 0 {
|
if p.maxConflicts == 0 {
|
||||||
if err := osutil.Remove(name); err != nil && !os.IsNotExist(err) {
|
if err := osutil.Remove(name); err != nil && !os.IsNotExist(err) {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user