summaryrefslogtreecommitdiff
path: root/reloadMtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'reloadMtime.go')
-rw-r--r--reloadMtime.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/reloadMtime.go b/reloadMtime.go
index 37ad2b6..d5425a1 100644
--- a/reloadMtime.go
+++ b/reloadMtime.go
@@ -8,7 +8,7 @@ import (
"path/filepath"
"time"
- "go.wit.com/lib/gui/shell"
+ "go.wit.com/lib/config"
"go.wit.com/log"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -51,7 +51,7 @@ func (repo *Repo) changedDir() bool {
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur))
repo.Times.MtimeDir = mtime
return true
}
@@ -72,7 +72,7 @@ func (repo *Repo) didFileChange(fname string, pbtime *timestamppb.Timestamp) boo
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s mtime changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s mtime changed %s", fname, config.FormatDuration(dur))
// need to reload from the filesystem
return true
}
@@ -103,7 +103,7 @@ func (repo *Repo) updateMtime(fname string, pbname string) bool {
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur))
repo.Times.MtimeHead = mtime
return true
}
@@ -126,7 +126,7 @@ func (repo *Repo) changedHead() bool {
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur))
repo.Times.MtimeHead = mtime
return true
}
@@ -151,7 +151,7 @@ func (repo *Repo) changedConfig() bool {
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur))
repo.Times.MtimeConfig = mtime
return true
}
@@ -173,7 +173,7 @@ func (repo *Repo) changedIndex() bool {
return false
}
dur := mtime.AsTime().Sub(pbtime.AsTime())
- repo.StateChange = fmt.Sprintf("%s changed %s", fname, shell.FormatDuration(dur))
+ repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur))
repo.Times.MtimeIndex = mtime
return true
}
@@ -211,6 +211,7 @@ func (repo *Repo) DidRepoChangeDir() error {
return log.Errorf(".git/HEAD changed")
}
if repo.didFileChange(".git/index", repo.Times.MtimeIndex) {
+ repo.StateChange += "jwc"
return log.Errorf(".git/index changed")
}
if repo.didFileChange(".git/config", repo.Times.MtimeConfig) {
@@ -241,6 +242,7 @@ func (repo *Repo) DidRepoChange() error {
return log.Errorf(".git/HEAD changed")
}
if repo.didFileChange(".git/index", repo.Times.MtimeIndex) {
+ repo.StateChange += "jwc2"
return log.Errorf(".git/index changed")
}
if repo.didFileChange(".git/config", repo.Times.MtimeConfig) {