aboutsummaryrefslogblamecommitdiffstats
path: root/bug/clocks.go
blob: 47cd1509d3d3378f968d1efdd91a3a2301670ca0 (plain) (tree)
1
2
3
4
5
6
7
8





                                                   

                                                                              





                                                








                                                           



                  
package bug

import (
	"github.com/MichaelMure/git-bug/repository"
)

// Witnesser will read all the available Bug to recreate the different logical
// clocks
func Witnesser(repo *repository.GitRepo) error {
	for b := range ReadAllLocalBugs(repo) {
		if b.Err != nil {
			return b.Err
		}

		err := repo.CreateWitness(b.Bug.createTime)
		if err != nil {
			return err
		}

		err = repo.EditWitness(b.Bug.editTime)
		if err != nil {
			return err
		}
	}

	return nil
}