aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-11 22:04:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-11 22:14:46 +0200
commit3605887345792d2f981f971c6c4a2cb7f86a343e (patch)
treeafd525b6e3a638e4c619a5a986fcb2811c297444 /cache
parent7b05983c19af4da70f2a9a5062913f4e4f5d5faa (diff)
downloadgit-bug-3605887345792d2f981f971c6c4a2cb7f86a343e.tar.gz
reorganize package for a more idomatic go
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_cache.go6
-rw-r--r--cache/bug_excerpt.go6
-rw-r--r--cache/repo_cache.go9
3 files changed, 11 insertions, 10 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go
index c9e1f2f5..cbb0d15a 100644
--- a/cache/bug_cache.go
+++ b/cache/bug_cache.go
@@ -4,8 +4,8 @@ import (
"io"
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/bug/operations"
- "github.com/MichaelMure/git-bug/util"
+ "github.com/MichaelMure/git-bug/operations"
+ "github.com/MichaelMure/git-bug/util/git"
)
type BugCache struct {
@@ -40,7 +40,7 @@ func (c *BugCache) AddComment(message string) error {
return c.notifyUpdated()
}
-func (c *BugCache) AddCommentWithFiles(message string, files []util.Hash) error {
+func (c *BugCache) AddCommentWithFiles(message string, files []git.Hash) error {
author, err := bug.GetUser(c.repoCache.repo)
if err != nil {
return err
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index a9dd6abb..426827e6 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -4,7 +4,7 @@ import (
"encoding/gob"
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/util"
+ "github.com/MichaelMure/git-bug/util/lamport"
)
// BugExcerpt hold a subset of the bug values to be able to sort and filter bugs
@@ -12,8 +12,8 @@ import (
type BugExcerpt struct {
Id string
- CreateLamportTime util.LamportTime
- EditLamportTime util.LamportTime
+ CreateLamportTime lamport.Time
+ EditLamportTime lamport.Time
CreateUnixTime int64
EditUnixTime int64
diff --git a/cache/repo_cache.go b/cache/repo_cache.go
index cd743e92..d8b14501 100644
--- a/cache/repo_cache.go
+++ b/cache/repo_cache.go
@@ -13,9 +13,10 @@ import (
"strings"
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/bug/operations"
+ "github.com/MichaelMure/git-bug/operations"
"github.com/MichaelMure/git-bug/repository"
- "github.com/MichaelMure/git-bug/util"
+ "github.com/MichaelMure/git-bug/util/git"
+ "github.com/MichaelMure/git-bug/util/process"
)
type RepoCache struct {
@@ -262,7 +263,7 @@ func (c *RepoCache) NewBug(title string, message string) (*BugCache, error) {
// NewBugWithFiles create a new bug with attached files for the message
// The new bug is written in the repository (commit)
-func (c *RepoCache) NewBugWithFiles(title string, message string, files []util.Hash) (*BugCache, error) {
+func (c *RepoCache) NewBugWithFiles(title string, message string, files []git.Hash) (*BugCache, error) {
author, err := bug.GetUser(c.repo)
if err != nil {
return nil, err
@@ -382,7 +383,7 @@ func repoIsAvailable(repo repository.Repo) error {
return err
}
- if util.ProcessIsRunning(pid) {
+ if process.IsRunning(pid) {
return fmt.Errorf("the repository you want to access is already locked by the process pid %d", pid)
}