diff options
author | Michael Muré <batolettre@gmail.com> | 2020-07-28 20:49:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 20:49:27 +0200 |
commit | 08e7bbfcde0ee90e1194624a76085e21a49758cd (patch) | |
tree | aae577f87b750905259925830ea43e142e75290e | |
parent | a15ad8391f8045e9a9eced026a9cf3bb2e12564e (diff) | |
parent | 92a59eceee0393b19479616f7531e6e8dba2a371 (diff) | |
download | git-bug-08e7bbfcde0ee90e1194624a76085e21a49758cd.tar.gz |
Merge pull request #437 from MichaelMure/fix-426
cache: fix BugExcerpt's timestamp not properly stored
-rw-r--r-- | cache/bug_excerpt.go | 16 | ||||
-rw-r--r-- | cache/repo_cache.go | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go index e9d5863f..14201c6a 100644 --- a/cache/bug_excerpt.go +++ b/cache/bug_excerpt.go @@ -23,8 +23,8 @@ type BugExcerpt struct { CreateLamportTime lamport.Time EditLamportTime lamport.Time - createUnixTime int64 - editUnixTime int64 + CreateUnixTime int64 + EditUnixTime int64 Status bug.Status Labels []bug.Label @@ -80,8 +80,8 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { Id: b.Id(), CreateLamportTime: b.CreateLamportTime(), EditLamportTime: b.EditLamportTime(), - createUnixTime: b.FirstOp().Time().Unix(), - editUnixTime: snap.EditTime().Unix(), + CreateUnixTime: b.FirstOp().Time().Unix(), + EditUnixTime: snap.EditTime().Unix(), Status: snap.Status, Labels: snap.Labels, Actors: actorsIds, @@ -107,11 +107,11 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { } func (b *BugExcerpt) CreateTime() time.Time { - return time.Unix(b.createUnixTime, 0) + return time.Unix(b.CreateUnixTime, 0) } func (b *BugExcerpt) EditTime() time.Time { - return time.Unix(b.editUnixTime, 0) + return time.Unix(b.EditUnixTime, 0) } /* @@ -153,7 +153,7 @@ func (b BugsByCreationTime) Less(i, j int) bool { // by the first sorting using the logical clock. That means that if users // synchronize their bugs regularly, the timestamp will rarely be used, and // should still provide a kinda accurate sorting when needed. - return b[i].createUnixTime < b[j].createUnixTime + return b[i].CreateUnixTime < b[j].CreateUnixTime } func (b BugsByCreationTime) Swap(i, j int) { @@ -181,7 +181,7 @@ func (b BugsByEditTime) Less(i, j int) bool { // by the first sorting using the logical clock. That means that if users // synchronize their bugs regularly, the timestamp will rarely be used, and // should still provide a kinda accurate sorting when needed. - return b[i].editUnixTime < b[j].editUnixTime + return b[i].EditUnixTime < b[j].EditUnixTime } func (b BugsByEditTime) Swap(i, j int) { diff --git a/cache/repo_cache.go b/cache/repo_cache.go index 7e605a6e..89772455 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -19,8 +19,7 @@ import ( // 1: original format // 2: added cache for identities with a reference in the bug cache -// 3: CreateUnixTime --> createUnixTime, EditUnixTime --> editUnixTime -const formatVersion = 3 +const formatVersion = 2 var _ repository.RepoCommon = &RepoCache{} |