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 /bug | |
parent | b6087d7e35dd0f687264ef3a743ccc3871bd3b64 (diff) | |
download | git-bug-5675299c8dd9488c3b60142d8da8b112473a0cd4.tar.gz |
termui: commit the bug when quiting the show bug window
Diffstat (limited to 'bug')
-rw-r--r-- | bug/bug.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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() { |