diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-19 00:28:06 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-11-19 00:28:06 +0100 |
commit | ed2ac793e9f353720db2615b06569d05c253b977 (patch) | |
tree | 9c5e06aa4e1ef9b41ceb21408de493d2e91b3d00 /bug/bug.go | |
parent | a9b32e6bdaa610e2244816618a316bcdf53545e6 (diff) | |
download | git-bug-ed2ac793e9f353720db2615b06569d05c253b977.tar.gz |
bug: use NeedCommit() in the interface, drop HasPendingOp()
Diffstat (limited to 'bug/bug.go')
-rw-r--r-- | bug/bug.go | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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 { |