diff options
-rw-r--r-- | bug/clocks.go | 2 | ||||
-rw-r--r-- | repository/git.go | 2 | ||||
-rw-r--r-- | repository/repo.go | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/bug/clocks.go b/bug/clocks.go index 47cd1509..bb3d81f0 100644 --- a/bug/clocks.go +++ b/bug/clocks.go @@ -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 diff --git a/repository/git.go b/repository/git.go index af251aa2..c2f0da0a 100644 --- a/repository/git.go +++ b/repository/git.go @@ -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 diff --git a/repository/repo.go b/repository/repo.go index d0004c8b..3ae09057 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -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 |