summaryrefslogtreecommitdiff
path: root/reload.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-17 06:37:14 -0600
committerJeff Carr <[email protected]>2024-12-17 06:37:14 -0600
commit233f7bca767aab9df55adea409e9820050631586 (patch)
tree1ce61760e8b31077b9accc9b1da978d935a132d3 /reload.go
parent4bc95ad2684cb42159229b8198aa8a2377f80aa1 (diff)
lots of changes to isolate exec 'git'
Diffstat (limited to 'reload.go')
-rw-r--r--reload.go27
1 files changed, 3 insertions, 24 deletions
diff --git a/reload.go b/reload.go
index 7c910d3..0168ea8 100644
--- a/reload.go
+++ b/reload.go
@@ -13,36 +13,15 @@ func (repo *Repo) Reload() error {
repo.GoDeps = new(GoDeps)
repo.ParseGoSum()
- if repo.GoInfo != nil {
- repo.ReloadGo()
- }
-
repo.setLastTag()
repo.setCurrentBranchName()
+ repo.setRepoType()
// everything has been checked, now save the mtime's
repo.RepoChanged()
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
}
@@ -82,7 +61,7 @@ func (repo *Repo) setCurrentBranchName() {
r := repo.RunQuiet([]string{"git", "branch", "--show-current"})
output := strings.Join(r.Stdout, "\n")
if r.Error != nil {
- log.Log(GITPBWARN, "GetCurrentBranchName() not in a git repo?", r.Error, repo.GoPath)
+ log.Log(GITPBWARN, "GetCurrentBranchName() not in a git repo?", r.Error, repo.GetGoPath())
log.Log(GITPBWARN, "GetCurrentBranchName() output might have worked anyway:", output)
}
repo.CurrentBranchName = strings.TrimSpace(output)
@@ -98,7 +77,7 @@ func (repo *Repo) setCurrentBranchVersion() {
r := repo.RunQuiet([]string{"git", "describe", "--tags", "--always"})
output := strings.Join(r.Stdout, "\n")
if r.Error != nil {
- log.Log(GITPBWARN, "GetCurrentBranchVersion() not in a git repo?", r.Error, repo.GoPath)
+ log.Log(GITPBWARN, "GetCurrentBranchVersion() not in a git repo?", r.Error, repo.GetGoPath())
log.Log(GITPBWARN, "GetCurrentBranchVersion() output might have worked anyway:", output)
}
repo.CurrentBranchVersion = strings.TrimSpace(output)