repo: minor cleaning

Michael Muré created

Change summary

bug/clocks.go      | 2 +-
repository/git.go  | 2 +-
repository/repo.go | 4 ++++
3 files changed, 6 insertions(+), 2 deletions(-)

Detailed changes

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

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

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