diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-15 13:15:00 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-15 13:15:00 +0200 |
commit | 7bec0b1f134d213e7505fc2ac03ffea26f2193cc (patch) | |
tree | e263cccd84406843eacbc6bd184acdacb25a49d1 /cache | |
parent | b478cd1bcb4756b20f7f4b15fcf81f23e1a60a02 (diff) | |
download | git-bug-7bec0b1f134d213e7505fc2ac03ffea26f2193cc.tar.gz |
bug: add a data validation process to avoid merging incorrect operations
Diffstat (limited to 'cache')
-rw-r--r-- | cache/bug_cache.go | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go index 67c16e96..b0dbb6cc 100644 --- a/cache/bug_cache.go +++ b/cache/bug_cache.go @@ -44,7 +44,10 @@ func (c *BugCache) AddCommentWithFiles(message string, files []git.Hash) error { return err } - operations.CommentWithFiles(c.bug, author, message, files) + err = operations.CommentWithFiles(c.bug, author, message, files) + if err != nil { + return err + } return c.notifyUpdated() } @@ -74,7 +77,10 @@ func (c *BugCache) Open() error { return err } - operations.Open(c.bug, author) + err = operations.Open(c.bug, author) + if err != nil { + return err + } return c.notifyUpdated() } @@ -85,7 +91,10 @@ func (c *BugCache) Close() error { return err } - operations.Close(c.bug, author) + err = operations.Close(c.bug, author) + if err != nil { + return err + } return c.notifyUpdated() } @@ -96,7 +105,10 @@ func (c *BugCache) SetTitle(title string) error { return err } - operations.SetTitle(c.bug, author, title) + err = operations.SetTitle(c.bug, author, title) + if err != nil { + return err + } return c.notifyUpdated() } |