aboutsummaryrefslogtreecommitdiffstats
path: root/operations/create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-25 17:56:58 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-25 17:56:58 +0200
commit40c6e64e4badfd543dc98237e1aeb3d8958cfe90 (patch)
tree03a992d71a1bfa3f069a5ef179649c0cf8479764 /operations/create.go
parent5d7c3a76af85a857a6bb0bff5bac5282c0a9908f (diff)
downloadgit-bug-40c6e64e4badfd543dc98237e1aeb3d8958cfe90.tar.gz
cache: add raw edit functions to allow setting up the author, the timestamp and the metadatas
Diffstat (limited to 'operations/create.go')
-rw-r--r--operations/create.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/operations/create.go b/operations/create.go
index 49c69482..fd66e732 100644
--- a/operations/create.go
+++ b/operations/create.go
@@ -62,9 +62,9 @@ func (op CreateOperation) Validate() error {
return nil
}
-func NewCreateOp(author bug.Person, title, message string, files []git.Hash) CreateOperation {
+func NewCreateOp(author bug.Person, unixTime int64, title, message string, files []git.Hash) CreateOperation {
return CreateOperation{
- OpBase: bug.NewOpBase(bug.CreateOp, author),
+ OpBase: bug.NewOpBase(bug.CreateOp, author, unixTime),
Title: title,
Message: message,
Files: files,
@@ -72,13 +72,13 @@ func NewCreateOp(author bug.Person, title, message string, files []git.Hash) Cre
}
// Convenience function to apply the operation
-func Create(author bug.Person, title, message string) (*bug.Bug, error) {
- return CreateWithFiles(author, title, message, nil)
+func Create(author bug.Person, unixTime int64, title, message string) (*bug.Bug, error) {
+ return CreateWithFiles(author, unixTime, title, message, nil)
}
-func CreateWithFiles(author bug.Person, title, message string, files []git.Hash) (*bug.Bug, error) {
+func CreateWithFiles(author bug.Person, unixTime int64, title, message string, files []git.Hash) (*bug.Bug, error) {
newBug := bug.NewBug()
- createOp := NewCreateOp(author, title, message, files)
+ createOp := NewCreateOp(author, unixTime, title, message, files)
if err := createOp.Validate(); err != nil {
return nil, err