aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-09 14:45:02 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-09 14:45:02 +0200
commit5675299c8dd9488c3b60142d8da8b112473a0cd4 (patch)
treea8cbd22610c1321e32a04f641d73947c424ff52e /bug
parentb6087d7e35dd0f687264ef3a743ccc3871bd3b64 (diff)
downloadgit-bug-5675299c8dd9488c3b60142d8da8b112473a0cd4.tar.gz
termui: commit the bug when quiting the show bug window
Diffstat (limited to 'bug')
-rw-r--r--bug/bug.go7
1 files changed, 6 insertions, 1 deletions
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() {