diff options
author | Michael Muré <batolettre@gmail.com> | 2019-06-19 13:55:22 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-06-19 13:55:22 +0200 |
commit | 777ccb9c68e10bdd9b8a4d33449795dd6e52f768 (patch) | |
tree | 4daafb96a6edd5052d5b9d64c1f2619240efcfaf /bug/bug.go | |
parent | 470996a0cef56551262a2fb436b778d8fe4be941 (diff) | |
download | git-bug-777ccb9c68e10bdd9b8a4d33449795dd6e52f768.tar.gz |
bug: fix Bug's Lamport edit time potentially wrong due to rebase
Diffstat (limited to 'bug/bug.go')
-rw-r--r-- | bug/bug.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -130,7 +130,8 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) { } bug := Bug{ - id: id, + id: id, + editTime: 0, } // Load each OperationPack @@ -191,7 +192,10 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) { bug.createTime = lamport.Time(createTime) } - bug.editTime = lamport.Time(editTime) + // Due to rebase, edit Lamport time are not necessarily ordered + if editTime > uint64(bug.editTime) { + bug.editTime = lamport.Time(editTime) + } // Update the clocks if err := repo.CreateWitness(bug.createTime); err != nil { |