Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fs/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func DiffDirChanges(ctx context.Context, baseDir, diffDir string, source DiffSou
if kind == ChangeKindAdd || kind == ChangeKindDelete {
parent := filepath.Dir(path)

if _, ok := changedDirs[parent]; !ok && parent != "/" {
if _, ok := changedDirs[parent]; !ok && parent != string(os.PathSeparator) {
pi, err := os.Stat(filepath.Join(diffDir, parent))
if err := changeFn(ChangeKindModify, parent, pi, err); err != nil {
return err
Expand Down
8 changes: 4 additions & 4 deletions fs/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func RootPath(root, path string) (string, error) {
}
path = newpath
if i == linksWalked {
newpath = filepath.Join("/", newpath)
newpath = filepath.Join(string(os.PathSeparator), newpath)
if path == newpath {
return filepath.Join(root, newpath), nil
}
Expand All @@ -249,8 +249,8 @@ func walkLink(root, path string, linksWalked *int) (newpath string, islink bool,
return "", false, errTooManyLinks
}

path = filepath.Join("/", path)
if path == "/" {
path = filepath.Join(string(os.PathSeparator), path)
if path == string(os.PathSeparator) {
return path, false, nil
}
realPath := filepath.Join(root, path)
Expand Down Expand Up @@ -281,7 +281,7 @@ func walkLinks(root, path string, linksWalked *int) (string, error) {
return newpath, err
case file == "":
if os.IsPathSeparator(dir[len(dir)-1]) {
if dir == "/" {
if dir == string(os.PathSeparator) {
return dir, nil
}
return walkLinks(root, dir[:len(dir)-1], linksWalked)
Expand Down
Loading