forge/doPull.go

42 lines
1.0 KiB
Go

// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
// is every repo on the devel branch?
func doGitPull() error {
if me.forge.Config.Mode != forgepb.ForgeMode_MASTER {
if argv.Force == true {
log.Info("okay. you have forced the issue")
} else {
log.Info("forge requres being on the master branch")
log.Info("you must run:")
log.Info("")
log.Info("forge checkout master")
log.Info("")
return nil
}
}
// stats := me.forge.RillFuncError(rillPull)
log.Info("TODO: actually git pull here? this is a bad idea. stopping.")
submit := gitpb.NewRepos()
for repo := range me.forge.Repos.IterByFullPath() {
newrepo := new(gitpb.Repo)
newrepo.MasterHash = repo.MasterHash
newrepo.DevelHash = repo.DevelHash
newrepo.Namespace = repo.Namespace
newrepo.URL = repo.URL
submit.Append(newrepo)
}
submit.HttpPost(myServer(), "check")
return nil
}