diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-19 21:13:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-19 21:13:13 +0100 |
commit | dcf3feb0b5a30de47a29557c63cf3d67602753ee (patch) | |
tree | 0e7f3a6b94974869b4eaae40c6bf39a1214dc855 /bridge/launchpad | |
parent | 22085f30d3ddb51f8192c0776cf4c82749ab2cab (diff) | |
parent | d6d5978b6dbba1adffd91ff8b86bd5e8465978f5 (diff) | |
download | git-bug-dcf3feb0b5a30de47a29557c63cf3d67602753ee.tar.gz |
Merge pull request #254 from MichaelMure/import-events
Bridge: correctly emit NothingEvents
Diffstat (limited to 'bridge/launchpad')
-rw-r--r-- | bridge/launchpad/import.go | 7 |
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 } |