aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug_actions.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-02-14 12:38:09 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:38:09 +0100
commit45e540c178533ef9aab01b1c3e782bc63061e313 (patch)
treefe126c135f706515d38676b0e491fcbbd6e7814b /bug/bug_actions.go
parent1ced77af1a4bdbaa212a74bf0c56b2b81cdc5bd2 (diff)
downloadgit-bug-45e540c178533ef9aab01b1c3e782bc63061e313.tar.gz
bug: wrap dag.Entity into a full Bug in MergeAll
Diffstat (limited to 'bug/bug_actions.go')
-rw-r--r--bug/bug_actions.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index 6ca5ffd7..420fb08a 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -49,7 +49,26 @@ func MergeAll(repo repository.ClockedRepo, remote string, author identity.Interf
// invalidate entities if necessary.
identityResolver := identity.NewSimpleResolver(repo)
- return dag.MergeAll(def, repo, identityResolver, remote, author)
+ out := make(chan entity.MergeResult)
+
+ go func() {
+ defer close(out)
+
+ results := dag.MergeAll(def, repo, identityResolver, remote, author)
+
+ // wrap the dag.Entity into a complete Bug
+ for result := range results {
+ result := result
+ if result.Entity != nil {
+ result.Entity = &Bug{
+ Entity: result.Entity.(*dag.Entity),
+ }
+ }
+ out <- result
+ }
+ }()
+
+ return out
}
// RemoveBug will remove a local bug from its entity.Id