aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/launchpad/import.go
diff options
context:
space:
mode:
authoramine <hilalyamine@gmail.com>2019-11-19 20:12:07 +0100
committeramine <hilalyamine@gmail.com>2019-11-19 20:33:20 +0100
commitd6d5978b6dbba1adffd91ff8b86bd5e8465978f5 (patch)
treee59ac7b9f0ac75e22fca6ad428d9a07fce8a9d92 /bridge/launchpad/import.go
parent967f19a30f0668f4df16295adcc2708607140566 (diff)
downloadgit-bug-d6d5978b6dbba1adffd91ff8b86bd5e8465978f5.tar.gz
bridge/launchpad: importer correctly emit NothingEvent
Diffstat (limited to 'bridge/launchpad/import.go')
-rw-r--r--bridge/launchpad/import.go7
1 files changed, 3 insertions, 4 deletions
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
}