This commit is contained in:
@@ -8,7 +8,11 @@
|
||||
|
||||
package fs
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (BasicFilesystem) SymlinksSupported() bool {
|
||||
return true
|
||||
@@ -52,6 +56,20 @@ func (f *BasicFilesystem) Roots() ([]string, error) {
|
||||
return []string{"/"}, nil
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) resolveWin83(absPath string) string {
|
||||
return absPath
|
||||
// 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 {
|
||||
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)
|
||||
}
|
||||
|
||||
func rel(path, prefix string) string {
|
||||
return strings.TrimPrefix(strings.TrimPrefix(path, prefix), string(PathSeparator))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user