Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
Clean the root dir
Browse files Browse the repository at this point in the history
Otherwise a root that ends in / will cause vendor detection to loop
forever.

Fixes #382
  • Loading branch information
Edward Muller committed Dec 23, 2015
1 parent bf180cb commit fc15fcd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v44 2015/12/23

* Clean package roots when attempting to find a vendor directory so we don't loop forever.
* Fixes 382

# v43 2015/12/22

* Better error messages when parsing Godeps.json: Fixes #372
Expand Down
3 changes: 2 additions & 1 deletion list.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ func findDirForPath(path string, ip *build.Package) (string, error) {
// We need to check to see if the import exists in vendor/ folders up the hierachy of the importing package
if VendorExperiment && ip != nil {
debugln("resolving vendor posibilities:", ip.Dir, ip.Root)
for base := ip.Dir; base != ip.Root; base = filepath.Dir(base) {
cr := filepath.Clean(ip.Root)
for base := ip.Dir; base != cr; base = filepath.Dir(base) {
s := filepath.Join(base, "vendor", path)
debugln("Adding search dir:", s)
search = append(search, s)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
)

const version = 43
const version = 44

var cmdVersion = &Command{
Name: "version",
Expand Down

0 comments on commit fc15fcd

Please sign in to comment.