maybe works somewhat
This commit is contained in:
parent
a97b66e8f2
commit
934daa5a3b
12
clone.go
12
clone.go
|
@ -126,13 +126,11 @@ func (f *Forge) goClonePop(gopath string) (*gitpb.Repo, error) {
|
||||||
if gopath == "" {
|
if gopath == "" {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
fullpath := filepath.Join(f.GetGoSrc(), gopath)
|
newpath, newdir := filepath.Split(gopath)
|
||||||
if pb := f.FindAnyPath(fullpath); pb != nil {
|
if newdir == "" {
|
||||||
// repo already exists
|
// nothing to chop
|
||||||
return pb, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
newpath, _ := filepath.Split(gopath)
|
|
||||||
if repo, _ := f.urlClone(newpath, "https://"+newpath); repo != nil {
|
if repo, _ := f.urlClone(newpath, "https://"+newpath); repo != nil {
|
||||||
return repo, nil
|
return repo, nil
|
||||||
}
|
}
|
||||||
|
@ -140,7 +138,7 @@ func (f *Forge) goClonePop(gopath string) (*gitpb.Repo, error) {
|
||||||
if repo, err := f.goClonePop(newpath); repo != nil {
|
if repo, err := f.goClonePop(newpath); repo != nil {
|
||||||
return repo, err
|
return repo, err
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("forge.goClonePop() failed %s", gopath)
|
return nil, fmt.Errorf("forge.goClonePop() did not work %s", gopath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// clone a URL directly, also try cloning if 'go-import' is sent
|
// clone a URL directly, also try cloning if 'go-import' is sent
|
||||||
|
|
|
@ -47,20 +47,15 @@ func (f *Forge) ValidGoVersion(ver string) (bool, error) {
|
||||||
func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
|
func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
|
||||||
// log.Info("init worked for", newr.GoPath)
|
// log.Info("init worked for", newr.GoPath)
|
||||||
|
|
||||||
var mname string
|
|
||||||
if newr.GetMasterBranchName() == "" {
|
if newr.GetMasterBranchName() == "" {
|
||||||
// try to guess what the 'master' branch is
|
// try to guess what the 'master' branch is
|
||||||
if newr.IsBranch("guimaster") {
|
if newr.IsBranch("guimaster") {
|
||||||
mname = "guimaster"
|
|
||||||
newr.SetMasterBranchName("guimaster")
|
newr.SetMasterBranchName("guimaster")
|
||||||
} else if newr.IsBranch("master") {
|
} else if newr.IsBranch("master") {
|
||||||
mname = "master"
|
|
||||||
newr.SetMasterBranchName("master")
|
newr.SetMasterBranchName("master")
|
||||||
} else if newr.IsBranch("main") {
|
} else if newr.IsBranch("main") {
|
||||||
mname = "main"
|
|
||||||
newr.SetMasterBranchName("main")
|
newr.SetMasterBranchName("main")
|
||||||
} else {
|
} else {
|
||||||
mname = "master"
|
|
||||||
// todo, figure out the name from git
|
// todo, figure out the name from git
|
||||||
newr.SetMasterBranchName("master")
|
newr.SetMasterBranchName("master")
|
||||||
if newr.CheckoutMaster() {
|
if newr.CheckoutMaster() {
|
||||||
|
|
Loading…
Reference in New Issue