mirror of
https://github.com/grdl/git-get.git
synced 2026-02-04 17:59:49 +00:00
Make the URL scheme default to ssh instead of https and make it configurable
This commit is contained in:
17
pkg/get.go
17
pkg/get.go
@@ -8,12 +8,13 @@ import (
|
||||
|
||||
// GetCfg provides configuration for the Get command.
|
||||
type GetCfg struct {
|
||||
Branch string
|
||||
DefHost string
|
||||
Dump string
|
||||
Root string
|
||||
SkipHost bool
|
||||
URL string
|
||||
Branch string
|
||||
DefHost string
|
||||
DefScheme string
|
||||
Dump string
|
||||
Root string
|
||||
SkipHost bool
|
||||
URL string
|
||||
}
|
||||
|
||||
// Get executes the "git get" command.
|
||||
@@ -33,7 +34,7 @@ func Get(c *GetCfg) error {
|
||||
}
|
||||
|
||||
func cloneSingleRepo(c *GetCfg) error {
|
||||
url, err := ParseURL(c.URL, c.DefHost)
|
||||
url, err := ParseURL(c.URL, c.DefHost, c.DefScheme)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -56,7 +57,7 @@ func cloneDumpFile(c *GetCfg) error {
|
||||
}
|
||||
|
||||
for _, line := range parsedLines {
|
||||
url, err := ParseURL(line.rawurl, c.DefHost)
|
||||
url, err := ParseURL(line.rawurl, c.DefHost, c.DefScheme)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user