aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/bug.go')
-rw-r--r--bug/bug.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/bug/bug.go b/bug/bug.go
index eb0337a4..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")
}
@@ -197,10 +197,10 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
}
// Update the clocks
- if err := repo.CreateWitness(bug.createTime); err != nil {
+ if err := repo.WitnessCreate(bug.createTime); err != nil {
return nil, errors.Wrap(err, "failed to update create lamport clock")
}
- if err := repo.EditWitness(bug.editTime); err != nil {
+ if err := repo.WitnessEdit(bug.editTime); err != nil {
return nil, errors.Wrap(err, "failed to update edit lamport clock")
}
@@ -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 {
@@ -592,6 +587,8 @@ func (bug *Bug) Merge(repo repository.Repo, other Interface) (bool, error) {
bug.lastCommit = hash
}
+ bug.packs = newPacks
+
// Update the git ref
err = repo.UpdateRef(bugsRefPattern+bug.id.String(), bug.lastCommit)
if err != nil {