package forgepb import ( "os/user" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) func (f *Forge) NewGoPath(gopath string) (*gitpb.Repo, error) { newr, err := f.Repos.NewGoPath(f.goSrc, gopath) if err != nil { log.Log(FORGEPBWARN, "init failed", err) panic("crapnuts") } log.Info("init worked for", newr.GoPath) // try to guess what the 'master' branch is if newr.IsBranch("guimaster") { newr.SetMasterBranchName("guimaster") } else if newr.IsBranch("master") { newr.SetMasterBranchName("master") } else if newr.IsBranch("main") { newr.SetMasterBranchName("main") } else { newr.SetMasterBranchName("masterFIXME") } if newr.IsBranch("guidevel") { newr.SetDevelBranchName("guidevel") } else if newr.IsBranch("devel") { newr.SetDevelBranchName("devel") } else { newr.SetDevelBranchName("develFIXME") } usr, _ := user.Current() uname := usr.Username if newr.IsBranch(uname) { newr.SetUserBranchName(uname) } else { newr.SetUserBranchName(uname + "FIXME") } return newr, err }