summaryrefslogtreecommitdiff
path: root/checkout.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-30 02:24:47 -0600
committerJeff Carr <[email protected]>2025-01-30 02:24:47 -0600
commit387f69631bacb449372406ea49af3b42f43fdb46 (patch)
treefcd1071609b11f5462aaca5f42ade14d8460db3c /checkout.go
parent57e38ee8ce56ba494c049a1dd10abb6c72fb1ca2 (diff)
trying to fix user create branchv0.0.68
Diffstat (limited to 'checkout.go')
-rw-r--r--checkout.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/checkout.go b/checkout.go
index 2b0e3f2..2180c22 100644
--- a/checkout.go
+++ b/checkout.go
@@ -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())