Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 3a26859

Browse files
committed
check: Stop filepath.Join on vendor paths
This is sad, but it's the fastest way to satisfy the test harness running on Windows.
1 parent 354108c commit 3a26859

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

cmd/dep/check.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,27 @@ func (cmd *checkCommand) Run(ctx *dep.Ctx, args []string) error {
132132
}
133133

134134
for pr, status := range statuses {
135-
vpr := filepath.Join("vendor", string(pr))
136135
switch status {
137136
case verify.NotInTree:
138-
logger.Printf("%s: missing from vendor\n", vpr)
137+
logger.Printf("%s: missing from vendor\n", pr)
139138
case verify.NotInLock:
140-
fi, err := os.Stat(filepath.Join(p.AbsRoot, vpr))
139+
fi, err := os.Stat(filepath.Join(p.AbsRoot, "vendor", pr))
141140
if err != nil {
142141
return errors.Wrap(err, "could not stat file that VerifyVendor claimed existed")
143142
}
144143

145144
if fi.IsDir() {
146-
logger.Printf("%s: unused project\n", vpr)
145+
logger.Printf("%s: unused project\n", pr)
147146
} else {
148-
logger.Printf("%s: orphaned file\n", vpr)
147+
logger.Printf("%s: orphaned file\n", pr)
149148
}
150149
case verify.DigestMismatchInLock:
151-
logger.Printf("%s: hash of vendored tree didn't match digest in Gopkg.lock\n", vpr)
150+
logger.Printf("%s: hash of vendored tree didn't match digest in Gopkg.lock\n", pr)
152151
case verify.HashVersionMismatch:
153152
// This will double-print if the hash version is zero, but
154153
// that's a rare case that really only occurs before the first
155154
// run with a version of dep >=0.5.0, so it's fine.
156-
logger.Printf("%s: hash algorithm mismatch, want version %v\n", vpr, verify.HashVersion)
155+
logger.Printf("%s: hash algorithm mismatch, want version %v\n", pr, verify.HashVersion)
157156
}
158157
}
159158
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# vendor is out of sync:
2-
vendor/github.com/sdboyer/deptest: hash of vendored tree didn't match digest in Gopkg.lock
2+
github.com/sdboyer/deptest: hash of vendored tree didn't match digest in Gopkg.lock
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# vendor is out of sync:
2-
vendor/github.com/sdboyer/deptest: hash algorithm mismatch, want version 1
2+
github.com/sdboyer/deptest: hash algorithm mismatch, want version 1

cmd/dep/testdata/harness_tests/check/unmet_constraint/stdout.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
github.com/sdboyer/[email protected]: not allowed by constraint master
33

44
# vendor is out of sync:
5-
vendor/github.com/sdboyer/deptest: missing from vendor
5+
github.com/sdboyer/deptest: missing from vendor

cmd/dep/testdata/harness_tests/check/unmet_override/stdout.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
github.com/sdboyer/[email protected]: not allowed by override master
33

44
# vendor is out of sync:
5-
vendor/github.com/sdboyer/deptest: missing from vendor
5+
github.com/sdboyer/deptest: missing from vendor
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# vendor is out of sync:
2-
vendor/orphdir: unused project
3-
vendor/foo: orphaned file
2+
foo: orphaned file
3+
orphdir: unused project

0 commit comments

Comments
 (0)