aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug_actions.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-08-18 16:03:48 +0200
committerGitHub <noreply@github.com>2022-08-18 16:03:48 +0200
commit6664a251f1893e6ddc183aa6061d6f0fd4f40a57 (patch)
treee42bcfc39ccf9284f645dde7ae5990c6d4995ade /bug/bug_actions.go
parentec24de3f0d19ff1a56d0b12d389ec1535be43ea2 (diff)
parent45f5f852b71a63c142bca8b05efe53eebf142594 (diff)
downloadgit-bug-6664a251f1893e6ddc183aa6061d6f0fd4f40a57.tar.gz
Merge pull request #844 from MichaelMure/resolvers
WIP resolvers
Diffstat (limited to 'bug/bug_actions.go')
-rw-r--r--bug/bug_actions.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index c8239e41..3a8ec3f0 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -24,13 +24,13 @@ func Push(repo repository.Repo, remote string) (string, error) {
// This function will return an error if a merge fail
// Note: an author is necessary for the case where a merge commit is created, as this commit will
// have an author and may be signed if a signing key is available.
-func Pull(repo repository.ClockedRepo, remote string, mergeAuthor identity.Interface) error {
+func Pull(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) error {
_, err := Fetch(repo, remote)
if err != nil {
return err
}
- for merge := range MergeAll(repo, remote, mergeAuthor) {
+ for merge := range MergeAll(repo, resolvers, remote, mergeAuthor) {
if merge.Err != nil {
return merge.Err
}
@@ -45,18 +45,13 @@ func Pull(repo repository.ClockedRepo, remote string, mergeAuthor identity.Inter
// MergeAll will merge all the available remote bug
// Note: an author is necessary for the case where a merge commit is created, as this commit will
// have an author and may be signed if a signing key is available.
-func MergeAll(repo repository.ClockedRepo, remote string, mergeAuthor identity.Interface) <-chan entity.MergeResult {
- // no caching for the merge, we load everything from git even if that means multiple
- // copy of the same entity in memory. The cache layer will intercept the results to
- // invalidate entities if necessary.
- identityResolver := identity.NewSimpleResolver(repo)
-
+func MergeAll(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) <-chan entity.MergeResult {
out := make(chan entity.MergeResult)
go func() {
defer close(out)
- results := dag.MergeAll(def, repo, identityResolver, remote, mergeAuthor)
+ results := dag.MergeAll(def, repo, resolvers, remote, mergeAuthor)
// wrap the dag.Entity into a complete Bug
for result := range results {