aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/github')
-rw-r--r--bridge/github/export_test.go7
-rw-r--r--bridge/github/import.go3
2 files changed, 7 insertions, 3 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go
index 93cc47c0..de2d3f34 100644
--- a/bridge/github/export_test.go
+++ b/bridge/github/export_test.go
@@ -16,6 +16,7 @@ import (
"github.com/MichaelMure/git-bug/bridge/core"
"github.com/MichaelMure/git-bug/bridge/core/auth"
"github.com/MichaelMure/git-bug/cache"
+ "github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/interrupt"
@@ -66,13 +67,15 @@ func testCases(t *testing.T, repo *cache.RepoCache) []*testCase {
bugWithCommentEditions, createOp, err := repo.NewBug("bug with comments editions", "new bug")
require.NoError(t, err)
- _, err = bugWithCommentEditions.EditComment(createOp.Id(), "first comment edited")
+ _, err = bugWithCommentEditions.EditComment(
+ entity.CombineIds(bugWithCommentEditions.Id(), createOp.Id()), "first comment edited")
require.NoError(t, err)
commentOp, err := bugWithCommentEditions.AddComment("first comment")
require.NoError(t, err)
- _, err = bugWithCommentEditions.EditComment(commentOp.Id(), "first comment edited")
+ _, err = bugWithCommentEditions.EditComment(
+ entity.CombineIds(bugWithCommentEditions.Id(), commentOp.Id()), "first comment edited")
require.NoError(t, err)
// bug status changed
diff --git a/bridge/github/import.go b/bridge/github/import.go
index 722bf256..5b2bf54b 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -405,6 +405,7 @@ func (gi *githubImporter) ensureCommentEdit(ctx context.Context, repo *cache.Rep
if err != nil {
return err
}
+ // check if the comment edition already exist
_, err = b.ResolveOperationWithMetadata(metaKeyGithubId, parseId(edit.Id))
if err == nil {
return nil
@@ -428,7 +429,7 @@ func (gi *githubImporter) ensureCommentEdit(ctx context.Context, repo *cache.Rep
op, err := b.EditCommentRaw(
editor,
edit.CreatedAt.Unix(),
- target,
+ entity.CombineIds(b.Id(), target),
text.Cleanup(string(*edit.Diff)),
map[string]string{
metaKeyGithubId: parseId(edit.Id),