mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
Fix subgroup parsing on subsequent installs (#93)
* Fix subgroup parsing on subsequent installs * enforce .git as remote suffix * fix integration tests * do not modify pointer receiver in getters * fix merged integration tests
This commit is contained in:
parent
d78a05a86f
commit
50b717beab
6 changed files with 28 additions and 28 deletions
|
|
@ -80,18 +80,18 @@ func (gs *Git) UnmarshalJSON(data []byte) error {
|
|||
|
||||
// Name returns the repository in a go-like format (example.com/user/repo/subdir)
|
||||
func (gs *Git) Name() string {
|
||||
return fmt.Sprintf("%s/%s/%s%s", gs.Host, gs.User, gs.Repo, gs.Subdir)
|
||||
return fmt.Sprintf("%s/%s/%s%s", gs.Host, gs.User, strings.TrimSuffix(gs.Repo, ".git"), gs.Subdir)
|
||||
}
|
||||
|
||||
// LegacyName returns the last element of the packages path
|
||||
// example: github.com/ksonnet/ksonnet-lib/ksonnet.beta.4 becomes ksonnet.beta.4
|
||||
func (gs *Git) LegacyName() string {
|
||||
return filepath.Base(gs.Repo + gs.Subdir)
|
||||
return filepath.Base(strings.TrimSuffix(gs.Repo, ".git") + gs.Subdir)
|
||||
}
|
||||
|
||||
var gitProtoFmts = map[string]string{
|
||||
GitSchemeSSH: GitSchemeSSH + "%s/%s/%s.git",
|
||||
GitSchemeHTTPS: GitSchemeHTTPS + "%s/%s/%s",
|
||||
GitSchemeHTTPS: GitSchemeHTTPS + "%s/%s/%s.git",
|
||||
}
|
||||
|
||||
// Remote returns a remote string that can be passed to git
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue