summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reload.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/reload.go b/reload.go
index bb122c0..282a1fc 100644
--- a/reload.go
+++ b/reload.go
@@ -8,7 +8,18 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
-// TODO: fix and clean this up. this is a work in progress
+// does a fast check with os.Stat()
+// if the mtimes changed, does a full repo.Reload()
+func (repo *Repo) ReloadCheck() error {
+ if !repo.DidRepoChange() {
+ return nil
+ }
+ // f.configSave = true
+ err := repo.Reload()
+ return err
+}
+
+// TODO: clean this up more, but it is working now more or less
func (repo *Repo) Reload() error {
// log.Info("in reload", repo.FullPath)
repo.Tags = new(GitTags)