diff options
| author | Jeff Carr <[email protected]> | 2025-01-19 03:45:10 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-19 03:45:10 -0600 |
| commit | 193d041306e5e669a4e9e7a965e2d3cae6f01a62 (patch) | |
| tree | 3becb10d468fba750d45758d22b0c50ffede1573 | |
| parent | b9d4f88abdde4ff72a454f875c64e9c513840a58 (diff) | |
git checkout on readonly reposv0.22.49
| -rw-r--r-- | doCheckout.go | 19 | ||||
| -rw-r--r-- | doClean.go | 4 |
2 files changed, 16 insertions, 7 deletions
diff --git a/doCheckout.go b/doCheckout.go index b168da3..85f73b3 100644 --- a/doCheckout.go +++ b/doCheckout.go @@ -140,16 +140,25 @@ func doAllCheckoutDevel() error { } func rillCheckoutMaster(repo *gitpb.Repo) error { + if repo.IsDirty() { + // never do dirty repos + return nil + } + if repo.GetCurrentBranchName() == repo.GetMasterBranchName() { + // repo is already on master + return nil + } if repo.GetUserVersion() != repo.GetDevelVersion() { - // don't switch braches if the user branch has uncommitted patches + // don't switch branches if the user branch has uncommitted patches return nil } - if repo.GetDevelVersion() != repo.GetMasterVersion() { - // don't switch braches if the devel branch does not match master (needs merge) + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { + // skip other checks for readonly repos + repo.CheckoutMaster() return nil } - if repo.GetCurrentBranchName() == repo.GetMasterBranchName() { - // repo is already on master + if repo.GetDevelVersion() != repo.GetMasterVersion() { + // don't switch braches if the devel branch does not match master (needs merge) return nil } repo.CheckoutMaster() @@ -184,8 +184,8 @@ func userToDevelRequiresGitPush(repo *gitpb.Repo, branchName string) error { return fmt.Errorf("user branch not clean to delete %d %d", missing, b2) } if missing == 0 { - log.Info("THIS MEANS THE LOCAL BRANCH IS OK TO DELETE missing =", missing) - return nil + // log.Info("THIS MEANS THE LOCAL BRANCH IS OK TO DELETE missing =", missing) + log.Info("THIS IS REALLY BAD RIGHT NOW. must to git push / git merge missing =", missing, b2) } return fmt.Errorf("user branch not clean to delete. maybe it is? devel might be ahead of user branch. %d %d", missing, b2) } |
