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

Commit

Permalink
Don't require a revision to import govendor config
Browse files Browse the repository at this point in the history
There are valid govendor configs in the wild that do not have a revision
set, essentially requiring the package but not locking to a revision. We
should allow that and not stop the import.
  • Loading branch information
carolynvs committed Nov 11, 2017
1 parent c2b497a commit 4c3bdf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions internal/importers/govendor/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,8 @@ func (g *Importer) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock, error)
return nil, nil, err
}

// Revision must not be empty
if pkg.Revision == "" {
err := errors.New("invalid govendor configuration, Revision is required")
return nil, nil, err
}
// There are valid govendor configs in the wild that don't have a revision set
// so we are not requiring it to be set during import

ip := base.ImportedPackage{
Name: pkg.Path,
Expand Down
4 changes: 2 additions & 2 deletions internal/importers/govendor/importer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestGovendorConfig_Convert(t *testing.T) {
WantConvertErr: true,
},
},
"missing package revision": {
"missing package revision doesn't cause an error": {
govendorFile{
Package: []*govendorPackage{
{
Expand All @@ -133,7 +133,7 @@ func TestGovendorConfig_Convert(t *testing.T) {
},
},
importertest.TestCase{
WantConvertErr: true,
WantConstraint: "*",
},
},
}
Expand Down

0 comments on commit 4c3bdf0

Please sign in to comment.