summaryrefslogtreecommitdiff
path: root/reload.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 05:18:19 -0500
committerJeff Carr <[email protected]>2025-09-11 05:18:19 -0500
commit33c585f4cfc92ba3d018f6e0758704bc533481cd (patch)
treed1c6e6b431d976a1400381860466bd49cb5aa1fd /reload.go
parent7d60a495cab6c26c3ecf7ee7aa968c1a39e88176 (diff)
look for out of date remote branches
Diffstat (limited to 'reload.go')
-rw-r--r--reload.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/reload.go b/reload.go
index 7c96847..12786f4 100644
--- a/reload.go
+++ b/reload.go
@@ -54,12 +54,30 @@ func (repo *Repo) Reload() error {
}
}
+ repo.VerifyRemoteAndLocalBranches(repo.GetDevelBranchName())
+ repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName())
+
// LastUpdate should always be the newest time
repo.Times.LastUpdate = timestamppb.New(time.Now())
repo.ValidateUTF8()
return nil
}
+func (repo *Repo) VerifyRemoteAndLocalBranches(bname string) bool {
+ if !repo.IsBranchRemote(bname) {
+ return true
+ }
+ lh := repo.GetLocalHash(bname)
+ rh := repo.GetRemoteHash(bname)
+ if lh == rh {
+ // log.Info(r.FullPath, "local devel == remote devel", lh, rh)
+ return true
+ } else {
+ log.Info(repo.FullPath, bname, "local != remote", lh, rh)
+ }
+ return false
+}
+
func (repo *Repo) SetDevelBranchName(bname string) {
repo.DevelBranchName = bname
}