diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-09 14:45:02 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-09 14:45:02 +0200 |
commit | 5675299c8dd9488c3b60142d8da8b112473a0cd4 (patch) | |
tree | a8cbd22610c1321e32a04f641d73947c424ff52e /cache/cache.go | |
parent | b6087d7e35dd0f687264ef3a743ccc3871bd3b64 (diff) | |
download | git-bug-5675299c8dd9488c3b60142d8da8b112473a0cd4.tar.gz |
termui: commit the bug when quiting the show bug window
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 +} |