summaryrefslogtreecommitdiff
path: root/checkout.go
diff options
context:
space:
mode:
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())