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, 9 insertions, 6 deletions
diff --git a/bug/bug.go b/bug/bug.go
index c5268cc2..7f068c05 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -182,17 +182,17 @@ func (bug *Bug) IsValid() bool {
}
}
- // The very first Op should be a CREATE
+ // The very first Op should be a CreateOp
firstOp := bug.firstOp()
- if firstOp == nil || firstOp.OpType() != CREATE {
+ if firstOp == nil || firstOp.OpType() != CreateOp {
return false
}
- // Check that there is no more CREATE op
+ // Check that there is no more CreateOp op
it := NewOperationIterator(bug)
createCount := 0
for it.Next() {
- if it.Value().OpType() == CREATE {
+ if it.Value().OpType() == CreateOp {
createCount++
}
}
@@ -351,7 +351,7 @@ func (bug *Bug) HumanId() string {
}
// Lookup for the very first operation of the bug.
-// For a valid Bug, this operation should be a CREATE
+// For a valid Bug, this operation should be a CreateOp
func (bug *Bug) firstOp() Operation {
for _, pack := range bug.packs {
for _, op := range pack.Operations {
@@ -368,7 +368,10 @@ func (bug *Bug) firstOp() Operation {
// Compile a bug in a easily usable snapshot
func (bug *Bug) Compile() Snapshot {
- snap := Snapshot{}
+ snap := Snapshot{
+ id: bug.id,
+ Status: OpenStatus,
+ }
it := NewOperationIterator(bug)