From 5675299c8dd9488c3b60142d8da8b112473a0cd4 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 9 Aug 2018 14:45:02 +0200 Subject: termui: commit the bug when quiting the show bug window --- bug/bug.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bug') diff --git a/bug/bug.go b/bug/bug.go index b90beaa7..3c52adc8 100644 --- a/bug/bug.go +++ b/bug/bug.go @@ -299,11 +299,16 @@ func (bug *Bug) IsValid() bool { return true } -// Append an operation into the staging area, to be commited later +// Append an operation into the staging area, to be committed later func (bug *Bug) Append(op Operation) { bug.staging.Append(op) } +// Return if the bug need to be committed +func (bug *Bug) HasPendingOp() bool { + return !bug.staging.IsEmpty() +} + // Write the staging area in Git and move the operations to the packs func (bug *Bug) Commit(repo repository.Repo) error { if bug.staging.IsEmpty() { -- cgit