git-bug/bug/clocks.go

28 lines
471 B
Go
Raw Normal View History

package bug
import (
"github.com/MichaelMure/git-bug/repository"
)
2018-08-13 16:28:16 +03:00
// Witnesser will read all the available Bug to recreate the different logical
// clocks
2018-12-25 18:35:37 +03:00
func Witnesser(repo repository.ClockedRepo) error {
for b := range ReadAllLocalBugs(repo) {
if b.Err != nil {
return b.Err
}
2018-09-13 13:43:47 +03:00
err := repo.CreateWitness(b.Bug.createTime)
if err != nil {
return err
}
err = repo.EditWitness(b.Bug.editTime)
if err != nil {
return err
}
}
return nil
}