aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
commit76ac1787b8de8698b878d1837c5fa8f6fe6403fc (patch)
tree2261d605eb533bc5f037887a983da0039281c9f5 /bug/bug.go
parent7b19b10e19e5dbbae79a47d3e4338b15b3e8d972 (diff)
downloadgit-bug-76ac1787b8de8698b878d1837c5fa8f6fe6403fc.tar.gz
add bug status + open/close commands
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)