diff --git a/bug/bug_actions.go b/bug/bug_actions.go index 6ca5ffd776a0836d72a656363c931f686c0244a4..420fb08af5c96230fc7ba199156d9a6337fd288f 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 diff --git a/cache/repo_cache_test.go b/cache/repo_cache_test.go index a85fde66be5bbb9efbfe41cc83f963061b957c84..35dc4ffdfe7cd23306b053b5d46fa5fb8bca7eb7 100644 --- a/cache/repo_cache_test.go +++ b/cache/repo_cache_test.go @@ -108,7 +108,7 @@ func TestCache(t *testing.T) { require.NoError(t, err) } -func TestPushPull(t *testing.T) { +func TestCachePushPull(t *testing.T) { repoA, repoB, remote := repository.SetupGoGitReposAndRemote() defer repository.CleanupTestRepos(repoA, repoB, remote) diff --git a/entity/dag/entity_actions_test.go b/entity/dag/entity_actions_test.go index 402f459cd14ce8ac5d15d71223e7d6a01997838b..45e69c7d9b3067248ce0241c85141e700e06de8e 100644 --- a/entity/dag/entity_actions_test.go +++ b/entity/dag/entity_actions_test.go @@ -23,7 +23,7 @@ func allEntities(t testing.TB, bugs <-chan StreamedEntity) []*Entity { return result } -func TestPushPull(t *testing.T) { +func TestEntityPushPull(t *testing.T) { repoA, repoB, remote, id1, id2, resolver, def := makeTestContextRemote(t) defer repository.CleanupTestRepos(repoA, repoB, remote) diff --git a/identity/identity_actions_test.go b/identity/identity_actions_test.go index 54cb2a4682c610cfdfcdfd33f2652883a163f27d..2a5954d6af84983a5b67909da9d5ef93d85ff14a 100644 --- a/identity/identity_actions_test.go +++ b/identity/identity_actions_test.go @@ -8,7 +8,7 @@ import ( "github.com/MichaelMure/git-bug/repository" ) -func TestPushPull(t *testing.T) { +func TestIdentityPushPull(t *testing.T) { repoA, repoB, remote := repository.SetupGoGitReposAndRemote() defer repository.CleanupTestRepos(repoA, repoB, remote)