summaryrefslogtreecommitdiff
path: root/doCheckout.go
diff options
context:
space:
mode:
Diffstat (limited to 'doCheckout.go')
-rw-r--r--doCheckout.go19
1 files changed, 14 insertions, 5 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()