summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doMerge.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/doMerge.go b/doMerge.go
index 13b5000..f0f18b2 100644
--- a/doMerge.go
+++ b/doMerge.go
@@ -97,19 +97,34 @@ func safeToPublish() error {
log.Info("you currently have no repos with patches")
return log.Errorf("no repos to publish")
}
+ // check if any are dirty
for repo := range found.IterAll() {
- if err := hashesMatch(repo); err != nil {
- return err
- }
if repo.CheckDirty() {
return log.Errorf("%s repo is dirty", repo.FullPath)
}
+ }
+ // check the hashes
+ for repo := range found.IterAll() {
+ if err := hashesMatch(repo); err != nil {
+ return err
+ }
+ }
+ // move them all the the master branch
+ var bad bool
+ for repo := range found.IterAll() {
if repo.GetCurrentBranchName() != repo.GetMasterBranchName() {
- return log.Errorf("%s repo is not on master branch", repo.FullPath)
+ repo.CheckoutMaster()
+ bad = true
}
return log.Errorf("%s todo: check if repo is completely merged", repo.FullPath)
}
- return log.Errorf("notsure")
+ if bad {
+ return log.Errorf("some repos had to be switched to the master branch")
+ }
+ if !argv.Force {
+ return log.Errorf("notsure. it might be safe to publish(?)")
+ }
+ return nil
}
func doMergeReport() *forgepb.Patches {