From 80d3e94284766490cfa4dac8e9fb1e6d0c64b360 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 27 Sep 2025 02:12:08 -0500 Subject: repo handling --- doRepos.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'doRepos.go') diff --git a/doRepos.go b/doRepos.go index 0c79704..f33385d 100644 --- a/doRepos.go +++ b/doRepos.go @@ -4,10 +4,12 @@ import ( "os" "time" + "go.wit.com/lib/config" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" + "google.golang.org/protobuf/proto" ) func doRepos() error { @@ -25,13 +27,26 @@ func doRepos() error { return err } - if argv.Repos.Reload != nil { + if argv.Repos.Fix != nil { for repo := range me.forge.Repos.IterAll() { if repo.GetMasterBranchName() == "" { me.forge.VerifyBranchNames(repo) log.Info("ABNORMAL: master branch name was blank in", repo.GetFullPath()) } - + if repo.Tags == nil { + log.Infof("%s Tags == nil\n", repo.GetFullPath()) + continue + } + if repo.Tags.Master == nil { + if found := repo.GetRemoteTag(repo.GetMasterBranchName()); found != nil { + // log.Info("found master tag ", repo.FullPath, found) + repo.Tags.Master = proto.Clone(found).(*gitpb.GitTag) + config.SetChanged("repos", true) + } else { + log.Info("not found master tag (Reload() ?)", repo.FullPath) + } + continue + } } me.forge.SaveRepos() /* -- cgit v1.2.3