diff options
Diffstat (limited to 'cache/cache.go')
-rw-r--r-- | cache/cache.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cache/cache.go b/cache/cache.go index b6f47c6d..da0a2681 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -43,6 +43,7 @@ type BugCacher interface { SetTitle(title string) error Commit() error + CommitAsNeeded() error } // Cacher ------------------------ @@ -294,3 +295,10 @@ func (c *BugCache) SetTitle(title string) error { func (c *BugCache) Commit() error { return c.bug.Commit(c.repo) } + +func (c *BugCache) CommitAsNeeded() error { + if c.bug.HasPendingOp() { + return c.bug.Commit(c.repo) + } + return nil +} |