Skip to content

Commit

Permalink
Merge pull request #82 from endophage/flynnmaster
Browse files Browse the repository at this point in the history
simpler NormalizeTargets
  • Loading branch information
titanous committed May 6, 2015
2 parents 0fcbe88 + ae493bc commit e4c2efd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"io"
"io/ioutil"
"path"
"strings"

"github.com/flynn/go-tuf/data"
)
Expand Down Expand Up @@ -105,14 +104,7 @@ func GenerateFileMeta(r io.Reader, hashAlgorithms ...string) (data.FileMeta, err
}

func NormalizeTarget(p string) string {
if p == "" {
return "/"
}
s := path.Clean(p)
if strings.HasPrefix(s, "/") {
return s
}
return "/" + s
return path.Join("/", p)
}

func HashedPaths(p string, hashes data.Hashes) []string {
Expand Down

0 comments on commit e4c2efd

Please sign in to comment.