aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-12-25 16:35:37 +0100
committerMichael Muré <batolettre@gmail.com>2018-12-25 16:35:37 +0100
commit96f514168f17136fe02519ab4599a407cd0cc5cb (patch)
tree28ed1a2455ab1e74f5b0f5ab9a5081d90c7bdc3f
parent8a6a8055d723e523d9943244b042c778d75b02cc (diff)
downloadgit-bug-96f514168f17136fe02519ab4599a407cd0cc5cb.tar.gz
repo: minor cleaning
-rw-r--r--bug/clocks.go2
-rw-r--r--repository/git.go2
-rw-r--r--repository/repo.go4
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