|
@@ -1,7 +1,6 @@
|
|
package remotecontext
|
|
package remotecontext
|
|
|
|
|
|
import (
|
|
import (
|
|
- "fmt"
|
|
|
|
"os"
|
|
"os"
|
|
"sync"
|
|
"sync"
|
|
|
|
|
|
@@ -133,19 +132,6 @@ func (cs *CachableSource) Close() error {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
-func (cs *CachableSource) normalize(path string) (cleanpath, fullpath string, err error) {
|
|
|
|
- cleanpath = cs.root.Clean(string(cs.root.Separator()) + path)[1:]
|
|
|
|
- fullpath, err = cs.root.ResolveScopedPath(path, true)
|
|
|
|
- if err != nil {
|
|
|
|
- return "", "", fmt.Errorf("Forbidden path outside the context: %s (%s)", path, fullpath)
|
|
|
|
- }
|
|
|
|
- _, err = cs.root.Lstat(fullpath)
|
|
|
|
- if err != nil {
|
|
|
|
- return "", "", convertPathError(err, path)
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// Hash returns a hash for a single file in the source
|
|
// Hash returns a hash for a single file in the source
|
|
func (cs *CachableSource) Hash(path string) (string, error) {
|
|
func (cs *CachableSource) Hash(path string) (string, error) {
|
|
n := cs.getRoot()
|
|
n := cs.getRoot()
|