aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_add_comment.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-07-01 19:39:02 +0200
committerMichael Muré <batolettre@gmail.com>2020-07-01 19:39:02 +0200
commit3cf31fc4049fefc82db0a3d2018b5d98ab77c5d7 (patch)
treec77a29e1f35fefa5040454976c6edcf86e7678bc /bug/op_add_comment.go
parent33d510ac3999b3d8fa7a4652dc44a21c713f97de (diff)
downloadgit-bug-3cf31fc4049fefc82db0a3d2018b5d98ab77c5d7.tar.gz
repository: merge git.Hash in for one less /util package
Diffstat (limited to 'bug/op_add_comment.go')
-rw-r--r--bug/op_add_comment.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/bug/op_add_comment.go b/bug/op_add_comment.go
index 78c8847a..04965b8c 100644
--- a/bug/op_add_comment.go
+++ b/bug/op_add_comment.go
@@ -6,7 +6,7 @@ import (
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/identity"
- "github.com/MichaelMure/git-bug/util/git"
+ "github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/text"
"github.com/MichaelMure/git-bug/util/timestamp"
)
@@ -18,7 +18,7 @@ type AddCommentOperation struct {
OpBase
Message string `json:"message"`
// TODO: change for a map[string]util.hash to store the filename ?
- Files []git.Hash `json:"files"`
+ Files []repository.Hash `json:"files"`
}
// Sign-post method for gqlgen
@@ -53,7 +53,7 @@ func (op *AddCommentOperation) Apply(snapshot *Snapshot) {
snapshot.Timeline = append(snapshot.Timeline, item)
}
-func (op *AddCommentOperation) GetFiles() []git.Hash {
+func (op *AddCommentOperation) GetFiles() []repository.Hash {
return op.Files
}
@@ -82,8 +82,8 @@ func (op *AddCommentOperation) UnmarshalJSON(data []byte) error {
}
aux := struct {
- Message string `json:"message"`
- Files []git.Hash `json:"files"`
+ Message string `json:"message"`
+ Files []repository.Hash `json:"files"`
}{}
err = json.Unmarshal(data, &aux)
@@ -101,7 +101,7 @@ func (op *AddCommentOperation) UnmarshalJSON(data []byte) error {
// Sign post method for gqlgen
func (op *AddCommentOperation) IsAuthored() {}
-func NewAddCommentOp(author identity.Interface, unixTime int64, message string, files []git.Hash) *AddCommentOperation {
+func NewAddCommentOp(author identity.Interface, unixTime int64, message string, files []repository.Hash) *AddCommentOperation {
return &AddCommentOperation{
OpBase: newOpBase(AddCommentOp, author, unixTime),
Message: message,
@@ -122,7 +122,7 @@ func AddComment(b Interface, author identity.Interface, unixTime int64, message
return AddCommentWithFiles(b, author, unixTime, message, nil)
}
-func AddCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, files []git.Hash) (*AddCommentOperation, error) {
+func AddCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash) (*AddCommentOperation, error) {
addCommentOp := NewAddCommentOp(author, unixTime, message, files)
if err := addCommentOp.Validate(); err != nil {
return nil, err