aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-03-01 23:17:57 +0100
committerGitHub <noreply@github.com>2019-03-01 23:17:57 +0100
commit7260ca05bc3588c0572887a7d8f1b897c7fc13da (patch)
tree66854358df3cb9de651f7688556ec5a4b8ab1868 /repository/repo.go
parent0aefae6fcca5786f2c898029c3d6282f760f2c63 (diff)
parentb6bed784e5664819250aac20b2b9690879ee6ab1 (diff)
downloadgit-bug-7260ca05bc3588c0572887a7d8f1b897c7fc13da.tar.gz
Merge pull request #89 from MichaelMure/identity
WIP identity in git
Diffstat (limited to 'repository/repo.go')
-rw-r--r--repository/repo.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 3ae09057..8a66c320 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -83,6 +83,7 @@ type Repo interface {
GetTreeHash(commit git.Hash) (git.Hash, error)
}
+// ClockedRepo is a Repo that also has Lamport clocks
type ClockedRepo interface {
Repo
@@ -92,9 +93,15 @@ type ClockedRepo interface {
// WriteClocks write the clocks values into the repo
WriteClocks() error
+ // CreateTime return the current value of the creation clock
+ CreateTime() lamport.Time
+
// CreateTimeIncrement increment the creation clock and return the new value.
CreateTimeIncrement() (lamport.Time, error)
+ // EditTime return the current value of the edit clock
+ EditTime() lamport.Time
+
// EditTimeIncrement increment the edit clock and return the new value.
EditTimeIncrement() (lamport.Time, error)
@@ -122,7 +129,7 @@ func prepareTreeEntries(entries []TreeEntry) bytes.Buffer {
}
func readTreeEntries(s string) ([]TreeEntry, error) {
- split := strings.Split(s, "\n")
+ split := strings.Split(strings.TrimSpace(s), "\n")
casted := make([]TreeEntry, len(split))
for i, line := range split {