This commit is contained in:
@@ -11,10 +11,8 @@ package fs
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/syncthing/notify"
|
||||
)
|
||||
@@ -114,18 +112,3 @@ func (f *BasicFilesystem) eventType(notifyType notify.Event) EventType {
|
||||
}
|
||||
return NonRemove
|
||||
}
|
||||
|
||||
// unrootedChecked returns the path relative to the folder root (same as
|
||||
// unrooted). It panics if the given path is not a subpath and handles the
|
||||
// special case when the given path is the folder root without a trailing
|
||||
// pathseparator.
|
||||
func (f *BasicFilesystem) unrootedChecked(absPath, root string) string {
|
||||
absPath = f.resolveWin83(absPath)
|
||||
if absPath+string(PathSeparator) == root {
|
||||
return "."
|
||||
}
|
||||
if !strings.HasPrefix(absPath, root) {
|
||||
panic(fmt.Sprintf("bug: Notify backend is processing a change outside of the filesystem root: f.root==%v, root==%v, path==%v", f.root, root, absPath))
|
||||
}
|
||||
return rel(absPath, root)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user