From c53da5a9a1da1b29db24d4e1ce2b294514d99ac2 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 17 Dec 2024 00:00:49 -0600 Subject: smarter and faster mtime logic --- reload.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 reload.go (limited to 'reload.go') diff --git a/reload.go b/reload.go new file mode 100644 index 0000000..7a8c212 --- /dev/null +++ b/reload.go @@ -0,0 +1,39 @@ +package gitpb + +func (repo *Repo) Reload() error { + repo.Tags = new(GitTags) + repo.UpdateGitTags() + repo.GoDeps = new(GoDeps) + repo.ParseGoSum() + + if repo.GoInfo != nil { + repo.ReloadGo() + } + return nil +} + +func (repo *Repo) ReloadGo() error { + repo.GoPlugin = false + repo.GoProtobuf = false + repo.GoLibrary = false + repo.GoBinary = false + switch repo.goListRepoType() { + case "plugin": + repo.GoPlugin = true + case "protobuf": + repo.GoProtobuf = true + case "library": + repo.GoLibrary = true + case "binary": + repo.GoBinary = true + } + return nil +} + +func (repo *Repo) SetDevelBranchName(bname string) { + repo.DevelBranchName = bname +} + +func (repo *Repo) SetUserBranchName(bname string) { + repo.UserBranchName = bname +} -- cgit v1.2.3