aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_set_title.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-10-01 23:31:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-10-01 23:31:16 +0200
commit6ea6f3614e46a62f4a37c6afb488547a3d548191 (patch)
tree8a32431ce90dd8b169aac858b99a761b8f76c95f /bug/op_set_title.go
parentf026f61aaaa7b9e579e99f171f7fefb38c4c6181 (diff)
downloadgit-bug-6ea6f3614e46a62f4a37c6afb488547a3d548191.tar.gz
bug: in op convenience function, return the new op to be able to set metadata later
Diffstat (limited to 'bug/op_set_title.go')
-rw-r--r--bug/op_set_title.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/bug/op_set_title.go b/bug/op_set_title.go
index 9c523a2c..9b7d1533 100644
--- a/bug/op_set_title.go
+++ b/bug/op_set_title.go
@@ -95,7 +95,7 @@ func (s SetTitleTimelineItem) Hash() git.Hash {
}
// Convenience function to apply the operation
-func SetTitle(b Interface, author Person, unixTime int64, title string) error {
+func SetTitle(b Interface, author Person, unixTime int64, title string) (*SetTitleOperation, error) {
it := NewOperationIterator(b)
var lastTitleOp Operation
@@ -116,9 +116,9 @@ func SetTitle(b Interface, author Person, unixTime int64, title string) error {
setTitleOp := NewSetTitleOp(author, unixTime, title, was)
if err := setTitleOp.Validate(); err != nil {
- return err
+ return nil, err
}
b.Append(setTitleOp)
- return nil
+ return setTitleOp, nil
}