@@ -6,7 +6,7 @@ import (
// Witnesser will read all the available Bug to recreate the different logical
// clocks
-func Witnesser(repo *repository.GitRepo) error {
+func Witnesser(repo repository.ClockedRepo) error {
for b := range ReadAllLocalBugs(repo) {
if b.Err != nil {
return b.Err
@@ -67,7 +67,7 @@ func (repo *GitRepo) runGitCommand(args ...string) (string, error) {
// NewGitRepo determines if the given working directory is inside of a git repository,
// and returns the corresponding GitRepo instance if it is.
-func NewGitRepo(path string, witnesser func(repo *GitRepo) error) (*GitRepo, error) {
+func NewGitRepo(path string, witnesser Witnesser) (*GitRepo, error) {
repo := &GitRepo{Path: path}
// Check the repo and retrieve the root path
@@ -107,6 +107,10 @@ type ClockedRepo interface {
EditWitness(time lamport.Time) error
}
+// Witnesser is a function that will initialize the clocks of a repo
+// from scratch
+type Witnesser func(repo ClockedRepo) error
+
func prepareTreeEntries(entries []TreeEntry) bytes.Buffer {
var buffer bytes.Buffer