Skip to content

Commit db47e77

Browse files
cmd/go: change computeTestInputsID to use str.HasFilePathPrefix
For #26726 Change-Id: Ic1499abf847f161206462d9238bb19cdeba302c3
1 parent 2a59041 commit db47e77

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cmd/go/internal/test/test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"cmd/go/internal/load"
3030
"cmd/go/internal/lockedfile"
3131
"cmd/go/internal/modload"
32-
"cmd/go/internal/search"
3332
"cmd/go/internal/str"
3433
"cmd/go/internal/trace"
3534
"cmd/go/internal/work"
@@ -1875,7 +1874,7 @@ func computeTestInputsID(a *work.Action, testlog []byte) (cache.ActionID, error)
18751874
if !filepath.IsAbs(name) {
18761875
name = filepath.Join(pwd, name)
18771876
}
1878-
if a.Package.Root == "" || search.InDir(name, a.Package.Root) == "" {
1877+
if a.Package.Root == "" || str.HasFilePathPrefix(name, a.Package.Root) {
18791878
// Do not recheck files outside the module, GOPATH, or GOROOT root.
18801879
break
18811880
}
@@ -1884,7 +1883,7 @@ func computeTestInputsID(a *work.Action, testlog []byte) (cache.ActionID, error)
18841883
if !filepath.IsAbs(name) {
18851884
name = filepath.Join(pwd, name)
18861885
}
1887-
if a.Package.Root == "" || search.InDir(name, a.Package.Root) == "" {
1886+
if a.Package.Root == "" || str.HasFilePathPrefix(name, a.Package.Root) {
18881887
// Do not recheck files outside the module, GOPATH, or GOROOT root.
18891888
break
18901889
}

0 commit comments

Comments
 (0)