diff options
| author | Jeff Carr <[email protected]> | 2025-04-04 06:07:56 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-04-04 06:07:56 -0500 |
| commit | 06cf0f7d844192eacbaeec60e3cc12c9a7968469 (patch) | |
| tree | c4dfe63eb5999960274e27855dfdbc5d1c7ec464 /doCheckout.go | |
| parent | 99e30376f0a7835b564e408e877f2faca6ceae29 (diff) | |
fix defective google "Git on Borg" reposv0.22.114
Diffstat (limited to 'doCheckout.go')
| -rw-r--r-- | doCheckout.go | 16 |
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()) { |
