Skip to content

Commit

Permalink
refactor(api): Remove extraneous build data
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Jun 11, 2018
1 parent d90cc8a commit 79a162a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api/fossa/locator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fossa

import (
"net/url"
"regexp"
"strings"

Expand All @@ -15,10 +16,9 @@ type Locator struct {

func (l Locator) String() string {
if l.Fetcher != "git" {
return l.Fetcher + "+" + l.Project + "$" + l.Revision
return l.Fetcher + "+" + url.QueryEscape(l.Project) + "$" + l.Revision
}

return "git+" + NormalizeGitURL(l.Project) + "$" + l.Revision
return "git+" + url.QueryEscape(NormalizeGitURL(l.Project)) + "$" + l.Revision
}

func NormalizeGitURL(project string) string {
Expand Down
6 changes: 0 additions & 6 deletions api/fossa/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ func Normalize(modules []module.Module) ([]SourceUnit, error) {
for _, analyzed := range modules {
var deps []Dependency
for _, dep := range analyzed.Deps {
data, err := json.Marshal(dep)
if err != nil {
return nil, errors.Wrap(err, "could not marshal analyzed dependency")
}

var imports []string
for _, i := range dep.Imports {
imports = append(imports, LocatorOf(i.Resolved).String())
Expand All @@ -70,7 +65,6 @@ func Normalize(modules []module.Module) ([]SourceUnit, error) {
deps = append(deps, Dependency{
Locator: LocatorOf(dep.ID).String(),
Imports: imports,
Data: (*json.RawMessage)(&data),
})
}

Expand Down

0 comments on commit 79a162a

Please sign in to comment.