aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-06-19 13:55:22 +0200
committerMichael Muré <batolettre@gmail.com>2019-06-19 13:55:22 +0200
commit777ccb9c68e10bdd9b8a4d33449795dd6e52f768 (patch)
tree4daafb96a6edd5052d5b9d64c1f2619240efcfaf
parent470996a0cef56551262a2fb436b778d8fe4be941 (diff)
downloadgit-bug-777ccb9c68e10bdd9b8a4d33449795dd6e52f768.tar.gz
bug: fix Bug's Lamport edit time potentially wrong due to rebase
-rw-r--r--bug/bug.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 0604d11d..7e28954f 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -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 {