aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge/github/import.go2
-rw-r--r--bridge/launchpad/import.go7
2 files changed, 4 insertions, 5 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go
index b89e7e02..86444057 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -388,7 +388,6 @@ func (gi *githubImporter) ensureTimelineComment(repo *cache.RepoCache, b *cache.
for i, edit := range edits {
if i == 0 && targetOpID != "" {
// The first edit in the github result is the comment creation itself, we already have that
- gi.out <- core.NewImportNothing("", "comment already imported")
continue
}
@@ -418,6 +417,7 @@ func (gi *githubImporter) ensureTimelineComment(repo *cache.RepoCache, b *cache.
if err != nil {
return err
}
+ gi.out <- core.NewImportComment(op.Id())
// set target for the nexr edit now that the comment is created
targetOpID = op.Id()
diff --git a/bridge/launchpad/import.go b/bridge/launchpad/import.go
index 178945b6..59fc5c5f 100644
--- a/bridge/launchpad/import.go
+++ b/bridge/launchpad/import.go
@@ -103,8 +103,6 @@ func (li *launchpadImporter) ImportAll(ctx context.Context, repo *cache.RepoCach
/* Handle messages */
if len(lpBug.Messages) == 0 {
- err := fmt.Sprintf("bug doesn't have any comments")
- out <- core.NewImportNothing(entity.Id(lpBugID), err)
return
}
@@ -149,8 +147,9 @@ func (li *launchpadImporter) ImportAll(ctx context.Context, repo *cache.RepoCach
out <- core.NewImportComment(op.Id())
}
- err = b.CommitAsNeeded()
- if err != nil {
+ if !b.NeedCommit() {
+ out <- core.NewImportNothing(b.Id(), "no imported operation")
+ } else if err := b.Commit(); err != nil {
out <- core.NewImportError(err, "")
return
}