From 3cf31fc4049fefc82db0a3d2018b5d98ab77c5d7 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 1 Jul 2020 19:39:02 +0200 Subject: repository: merge git.Hash in for one less /util package --- bug/op_edit_comment.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bug/op_edit_comment.go') diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go index f82e7590..5bfc36bf 100644 --- a/bug/op_edit_comment.go +++ b/bug/op_edit_comment.go @@ -8,9 +8,9 @@ import ( "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/identity" + "github.com/MichaelMure/git-bug/repository" "github.com/MichaelMure/git-bug/util/timestamp" - "github.com/MichaelMure/git-bug/util/git" "github.com/MichaelMure/git-bug/util/text" ) @@ -19,9 +19,9 @@ var _ Operation = &EditCommentOperation{} // EditCommentOperation will change a comment in the bug type EditCommentOperation struct { OpBase - Target entity.Id `json:"target"` - Message string `json:"message"` - Files []git.Hash `json:"files"` + Target entity.Id `json:"target"` + Message string `json:"message"` + Files []repository.Hash `json:"files"` } // Sign-post method for gqlgen @@ -80,7 +80,7 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { } } -func (op *EditCommentOperation) GetFiles() []git.Hash { +func (op *EditCommentOperation) GetFiles() []repository.Hash { return op.Files } @@ -113,9 +113,9 @@ func (op *EditCommentOperation) UnmarshalJSON(data []byte) error { } aux := struct { - Target entity.Id `json:"target"` - Message string `json:"message"` - Files []git.Hash `json:"files"` + Target entity.Id `json:"target"` + Message string `json:"message"` + Files []repository.Hash `json:"files"` }{} err = json.Unmarshal(data, &aux) @@ -134,7 +134,7 @@ func (op *EditCommentOperation) UnmarshalJSON(data []byte) error { // Sign post method for gqlgen func (op *EditCommentOperation) IsAuthored() {} -func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.Id, message string, files []git.Hash) *EditCommentOperation { +func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.Id, message string, files []repository.Hash) *EditCommentOperation { return &EditCommentOperation{ OpBase: newOpBase(EditCommentOp, author, unixTime), Target: target, @@ -148,7 +148,7 @@ func EditComment(b Interface, author identity.Interface, unixTime int64, target return EditCommentWithFiles(b, author, unixTime, target, message, nil) } -func EditCommentWithFiles(b Interface, author identity.Interface, unixTime int64, target entity.Id, message string, files []git.Hash) (*EditCommentOperation, error) { +func EditCommentWithFiles(b Interface, author identity.Interface, unixTime int64, target entity.Id, message string, files []repository.Hash) (*EditCommentOperation, error) { editCommentOp := NewEditCommentOp(author, unixTime, target, message, files) if err := editCommentOp.Validate(); err != nil { return nil, err @@ -164,7 +164,7 @@ func EditCreateComment(b Interface, author identity.Interface, unixTime int64, m } // Convenience function to edit the body of a bug (the first comment) -func EditCreateCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, files []git.Hash) (*EditCommentOperation, error) { +func EditCreateCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash) (*EditCommentOperation, error) { createOp := b.FirstOp().(*CreateOperation) return EditCommentWithFiles(b, author, unixTime, createOp.Id(), message, files) } -- cgit