aboutsummaryrefslogtreecommitdiffstats
path: root/entities/bug/bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-08-25 11:19:43 +0200
committerMichael Muré <batolettre@gmail.com>2022-08-25 11:20:36 +0200
commit4c074099b8f305758ee88b319c7e0d32c2412038 (patch)
treeee1817f5101b3fbabfbaa3df2cba81330d8b8ec0 /entities/bug/bug.go
parent5c91174a84592b027c1b432a72ebf2974ec0e4c5 (diff)
downloadgit-bug-4c074099b8f305758ee88b319c7e0d32c2412038.tar.gz
generalized interface for an Entity
Diffstat (limited to 'entities/bug/bug.go')
-rw-r--r--entities/bug/bug.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/entities/bug/bug.go b/entities/bug/bug.go
index 1140c543..b0f46c0b 100644
--- a/entities/bug/bug.go
+++ b/entities/bug/bug.go
@@ -29,6 +29,10 @@ var def = dag.Definition{
var ClockLoader = dag.ClockLoader(def)
+type Interface interface {
+ dag.Interface[*Snapshot, Operation]
+}
+
// Bug holds the data of a bug thread, organized in a way close to
// how it will be persisted inside Git. This is the data structure
// used to merge two different version of the same Bug.
@@ -119,7 +123,7 @@ func (bug *Bug) Validate() error {
}
// Check that there is no more CreateOp op
- for i, op := range bug.Operations() {
+ for i, op := range bug.Entity.Operations() {
if i == 0 {
continue
}
@@ -146,7 +150,7 @@ func (bug *Bug) Operations() []Operation {
return result
}
-// Compile a bug in a easily usable snapshot
+// Compile a bug in an easily usable snapshot
func (bug *Bug) Compile() *Snapshot {
snap := &Snapshot{
id: bug.Id(),