summaryrefslogtreecommitdiff
path: root/doCheckout.go
diff options
context:
space:
mode:
Diffstat (limited to 'doCheckout.go')
-rw-r--r--doCheckout.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/doCheckout.go b/doCheckout.go
index 8621cc9..fcf095b 100644
--- a/doCheckout.go
+++ b/doCheckout.go
@@ -5,6 +5,7 @@ package main
import (
"fmt"
+ "os"
"path/filepath"
"time"
@@ -191,12 +192,19 @@ func rillCheckoutMaster(repo *gitpb.Repo) error {
// never do dirty repos
return nil
}
- if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
- // repo is already on master
+ // 'giterr' means something is very wrong with this repo
+ if repo.GetMasterVersion() == "giterr" {
+ repo.CheckoutMaster()
+ log.Info("master == giterr. BAD REPO", repo.GetFullPath())
+ log.Info("master == giterr. BAD REPO", repo.GetFullPath())
+ log.Info("master == giterr. BAD REPO", repo.GetFullPath())
+ cmd := []string{"git", "checkout", "main"} // todo: figure out main
+ repo.RunVerbose(cmd)
+ os.Exit(-1)
return nil
}
- if repo.GetUserVersion() == "uerr" {
- repo.CheckoutMaster()
+ if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
+ // repo is already on master
return nil
}
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {