From 8358fedaf4deffd385fbdac639a12fe2b89cfe50 Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sun, 1 Feb 2015 18:57:46 +0000 Subject: [PATCH] Fix failing integration tests --- cmd/syncthing/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index ca6ba93f..2c6fa6ef 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -874,8 +874,10 @@ func resetFolders() { suffix := fmt.Sprintf(".syncthing-reset-%d", time.Now().UnixNano()) for _, folder := range cfg.Folders() { if _, err := os.Stat(folder.Path); err == nil { - l.Infof("Reset: Moving %s -> %s", folder.Path, folder.Path+suffix) - os.Rename(folder.Path, folder.Path+suffix) + base := filepath.Base(folder.Path) + dir := filepath.Dir(filepath.Join(folder.Path, "..")) + l.Infof("Reset: Moving %s -> %s", folder.Path, filepath.Join(dir, base+suffix)) + os.Rename(folder.Path, filepath.Join(dir, base+suffix)) } }