aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-19 00:28:06 +0100
committerMichael Muré <batolettre@gmail.com>2019-11-19 00:28:06 +0100
commited2ac793e9f353720db2615b06569d05c253b977 (patch)
tree9c5e06aa4e1ef9b41ceb21408de493d2e91b3d00 /bug/bug.go
parenta9b32e6bdaa610e2244816618a316bcdf53545e6 (diff)
downloadgit-bug-ed2ac793e9f353720db2615b06569d05c253b977.tar.gz
bug: use NeedCommit() in the interface, drop HasPendingOp()
Diffstat (limited to 'bug/bug.go')
-rw-r--r--bug/bug.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/bug/bug.go b/bug/bug.go
index f1d36d52..ca817dc1 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -160,7 +160,7 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
rootFound = true
}
if strings.HasPrefix(entry.Name, createClockEntryPrefix) {
- n, err := fmt.Sscanf(string(entry.Name), createClockEntryPattern, &createTime)
+ n, err := fmt.Sscanf(entry.Name, createClockEntryPattern, &createTime)
if err != nil {
return nil, errors.Wrap(err, "can't read create lamport time")
}
@@ -169,7 +169,7 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
}
}
if strings.HasPrefix(entry.Name, editClockEntryPrefix) {
- n, err := fmt.Sscanf(string(entry.Name), editClockEntryPattern, &editTime)
+ n, err := fmt.Sscanf(entry.Name, editClockEntryPattern, &editTime)
if err != nil {
return nil, errors.Wrap(err, "can't read edit lamport time")
}
@@ -350,11 +350,6 @@ func (bug *Bug) Append(op Operation) {
bug.staging.Append(op)
}
-// HasPendingOp tell if the bug need to be committed
-func (bug *Bug) HasPendingOp() bool {
- return !bug.staging.IsEmpty()
-}
-
// Commit write the staging area in Git and move the operations to the packs
func (bug *Bug) Commit(repo repository.ClockedRepo) error {