aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-10 18:30:46 +0100
committerGitHub <noreply@github.com>2019-11-10 18:30:46 +0100
commit802b61e254c40042028d5f08bbed0968e78da265 (patch)
tree1672ea2925533bee62947f6e0a7027b1bff1cb7e /repository
parent350ab761d7b07df9bd49123130fe9807ea9a3d7e (diff)
parente0b15ee7644c20533156850e0be5a07597967450 (diff)
downloadgit-bug-802b61e254c40042028d5f08bbed0968e78da265.tar.gz
Merge pull request #219 from MichaelMure/global-config
Global config, global bridge token
Diffstat (limited to 'repository')
-rw-r--r--repository/config.go2
-rw-r--r--repository/config_git.go2
-rw-r--r--repository/git.go12
-rw-r--r--repository/repo.go6
4 files changed, 14 insertions, 8 deletions
diff --git a/repository/config.go b/repository/config.go
index d72e7b4e..4fa5c69b 100644
--- a/repository/config.go
+++ b/repository/config.go
@@ -38,7 +38,7 @@ type Config interface {
RemoveAll(keyPrefix string) error
}
-func parseTimestamp(s string) (time.Time, error) {
+func ParseTimestamp(s string) (time.Time, error) {
timestamp, err := strconv.Atoi(s)
if err != nil {
return time.Time{}, err
diff --git a/repository/config_git.go b/repository/config_git.go
index 63ca2457..cff82afb 100644
--- a/repository/config_git.go
+++ b/repository/config_git.go
@@ -116,7 +116,7 @@ func (gc *gitConfig) ReadTimestamp(key string) (time.Time, error) {
if err != nil {
return time.Time{}, err
}
- return parseTimestamp(value)
+ return ParseTimestamp(value)
}
func (gc *gitConfig) rmSection(keyPrefix string) error {
diff --git a/repository/git.go b/repository/git.go
index 2b00d1f2..2c72fccd 100644
--- a/repository/git.go
+++ b/repository/git.go
@@ -15,11 +15,15 @@ import (
"github.com/MichaelMure/git-bug/util/lamport"
)
-const createClockFile = "/git-bug/create-clock"
-const editClockFile = "/git-bug/edit-clock"
+const (
+ createClockFile = "/git-bug/create-clock"
+ editClockFile = "/git-bug/edit-clock"
+)
-// ErrNotARepo is the error returned when the git repo root wan't be found
-var ErrNotARepo = errors.New("not a git repository")
+var (
+ // ErrNotARepo is the error returned when the git repo root wan't be found
+ ErrNotARepo = errors.New("not a git repository")
+)
var _ ClockedRepo = &GitRepo{}
diff --git a/repository/repo.go b/repository/repo.go
index 7d655bde..e8c67a5e 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -10,8 +10,10 @@ import (
"github.com/MichaelMure/git-bug/util/lamport"
)
-var ErrNoConfigEntry = errors.New("no config entry for the given key")
-var ErrMultipleConfigEntry = errors.New("multiple config entry for the given key")
+var (
+ ErrNoConfigEntry = errors.New("no config entry for the given key")
+ ErrMultipleConfigEntry = errors.New("multiple config entry for the given key")
+)
// RepoCommon represent the common function the we want all the repo to implement
type RepoCommon interface {