summaryrefslogtreecommitdiff
path: root/doPull.go
blob: bacaf8e4820241e1780bb0d69b3b8df77e31f460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 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

}