2018-08-06 21:31:20 +03:00
|
|
|
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 {
|
2018-08-06 21:31:20 +03:00
|
|
|
for b := range ReadAllLocalBugs(repo) {
|
|
|
|
if b.Err != nil {
|
|
|
|
return b.Err
|
|
|
|
}
|
|
|
|
|
2019-11-19 02:27:40 +03:00
|
|
|
err := repo.WitnessCreate(b.Bug.createTime)
|
2018-09-13 13:43:47 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-11-19 02:27:40 +03:00
|
|
|
err = repo.WitnessEdit(b.Bug.editTime)
|
2018-09-13 13:43:47 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2018-08-06 21:31:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|