diff options
| -rw-r--r-- | age.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -49,14 +49,16 @@ func (repo *Repo) GitChanged() bool { } func (repo *Repo) GitPullAge() time.Duration { - lastpull, err := repo.LastGitPull() - if err == nil { + // lastpull, err := repo.LastGitPull() + lasttime, err := repo.oldMtime(".git/FETCH_HEAD") + if err != nil { // if error, something is wrong, assume true + log.Info("GitPullAge missing .git/FETCH_HEAD", repo.FullPath) ltime := repo.Times.LastPull.AsTime() return time.Since(ltime) } - return time.Since(lastpull) + return time.Since(lasttime) } func (repo *Repo) oldMtime(filename string) (time.Time, error) { |
