trying to fix user create branch

This commit is contained in:
Jeff Carr 2025-01-30 02:24:47 -06:00
parent 57e38ee8ce
commit 387f69631b
4 changed files with 14 additions and 8 deletions

View File

@ -1,7 +1,6 @@
package gitpb
import (
"fmt"
"path/filepath"
"go.wit.com/log"
@ -28,7 +27,7 @@ func (repo *Repo) CheckoutDevel() bool {
func (repo *Repo) CheckoutUser() error {
bName := repo.GetUserBranchName()
// log.Info("attempting checkout user", repo.GetGoPath(), bName)
err := repo.checkoutBranchNew(bName)
err := repo.createUserBranchNew(bName)
if err != nil {
log.Info("attempting checkout user error", repo.GetGoPath(), bName, err)
}
@ -68,7 +67,7 @@ func (repo *Repo) checkoutBranch(bName string) bool {
return true
}
func (repo *Repo) checkoutBranchNew(branch string) error {
func (repo *Repo) createUserBranchNew(branch string) error {
if branch == "" || branch == "uerr" {
log.Info("forge.gitpb logic err. branch name was:", branch)
return nil
@ -101,7 +100,14 @@ func (repo *Repo) checkoutBranchNew(branch string) error {
}
if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
return fmt.Errorf("repo must be on devel branch %s", repo.GetGoPath())
repo.CheckoutDevel()
}
repo.Reload()
if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
log.Info("create user branch will probably fail", repo.GetGoPath())
// TODO: FIX THIS
// return fmt.Errorf("repo must be on devel branch %s", repo.GetGoPath())
}
// log.Info("forge.gitpb try to create", branch, repo.GetGoPath())

View File

@ -21,8 +21,8 @@ func (repo *Repo) ParseGoSum() bool {
// that means, there is not a go.sum file
// because the package is completely self contained!
if err := repo.setPrimitive(); err != nil {
// temporarily enabled this
log.Info("gitpb.ParseGoSum()", err)
// temporarily enabled this. this is really noisy
// log.Info("gitpb.ParseGoSum()", err)
return false
}
if repo.GetGoPrimitive() {

View File

@ -73,7 +73,7 @@ func (repo *Repo) goListRepoType() string {
result, err := repo.RunQuiet(cmd)
if err != nil {
log.Warn("go list binary detect failed", err)
// log.Info("go list binary detect failed", err)
return ""
}
output := strings.TrimSpace(strings.Join(result.Stdout, "\n"))

View File

@ -48,7 +48,7 @@ func (repo *Repo) RunRealtimeVerbose(cmd []string) cmd.Status {
}
func (repo *Repo) RunQuiet(cmd []string) (*cmd.Status, error) {
result := shell.RunQuiet(cmd)
result := shell.PathRunQuiet(repo.FullPath, cmd)
if result.Error != nil {
log.Warn(repo.GetGoPath(), cmd, "wow. golang is cool. an os.Error:", result.Error)
return &result, result.Error