summaryrefslogtreecommitdiff
path: root/reload.go
diff options
context:
space:
mode:
Diffstat (limited to 'reload.go')
-rw-r--r--reload.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/reload.go b/reload.go
index f1ef298..bd6844f 100644
--- a/reload.go
+++ b/reload.go
@@ -19,22 +19,22 @@ func reposChanged(b bool) {
// returns true based on os.Stat() only checks
// seems to kinda work ok. goal is to avoid os.Exec() here for speed
// this might be the 1 place where libgit2 would be a good idea
-func (repo *Repo) HasChanged() bool {
+func (repo *Repo) HasChanged() error {
return repo.DidRepoChange()
}
// does a fast check with os.Stat()
// if the mtimes changed, does a full repo.ReloadForce()
func (repo *Repo) ReloadCheck() error {
- if !repo.DidRepoChange() {
+ err := repo.DidRepoChange()
+ if err == nil {
return nil
}
reposChanged(true)
- err := repo.ReloadForce()
- if err != nil {
+ if err := repo.ReloadForce(); err != nil {
return err
}
- return log.Errorf("gitpb.ReloadCheck() detected a change in the repo")
+ return err
}
// TODO: clean this up more, but it is working now more or less