diff options
Diffstat (limited to 'changed.go')
| -rw-r--r-- | changed.go | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -29,8 +29,12 @@ func (repo *Repo) changedDir() bool { // .git doesn't exist. something is wrong. rescan this repo return true } - pbtime := repo.Times.MtimeDir mtime := timestamppb.New(*fileTime) + pbtime := repo.Times.MtimeDir + if pbtime == nil { // this can happen? + repo.Times.MtimeDir = mtime + return true + } if (pbtime.Seconds == mtime.Seconds) && (pbtime.Nanos == mtime.Nanos) { return false } @@ -47,8 +51,13 @@ func (repo *Repo) changedHead() bool { // .git/HEAD doesn't exist. something is wrong. rescan this repo return true } - pbtime := repo.Times.MtimeHead mtime := timestamppb.New(*fileTime) + pbtime := repo.Times.MtimeHead + if pbtime == nil { // this can happen? + repo.Times.MtimeHead = mtime + return true + } + if (pbtime.Seconds == mtime.Seconds) && (pbtime.Nanos == mtime.Nanos) { return false } @@ -65,8 +74,12 @@ func (repo *Repo) changedIndex() bool { // .git/index doesn't exist. something is wrong. rescan this repo return true } - pbtime := repo.Times.MtimeIndex mtime := timestamppb.New(*fileTime) + pbtime := repo.Times.MtimeIndex + if pbtime == nil { // this can happen? + repo.Times.MtimeIndex = mtime + return true + } if (pbtime.Seconds == mtime.Seconds) && (pbtime.Nanos == mtime.Nanos) { return false } @@ -90,7 +103,7 @@ func (repo *Repo) RepoChanged() bool { changed = true } if repo.changedDir() { - changed = true + // changed = true } return changed |
