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/gitlab/import.go | |
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/gitlab/import.go')
-rw-r--r-- | bridge/gitlab/import.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index e92067af..92e9952e 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -73,8 +73,10 @@ func (gi *gitlabImporter) ImportAll(ctx context.Context, repo *cache.RepoCache, } } - // commit bug state - if err := b.CommitAsNeeded(); err != nil { + if !b.NeedCommit() { + out <- core.NewImportNothing(b.Id(), "no imported operation") + } else if err := b.Commit(); err != nil { + // commit bug state err := fmt.Errorf("bug commit: %v", err) out <- core.NewImportError(err, "") return @@ -99,7 +101,6 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue // resolve bug b, err := repo.ResolveBugCreateMetadata(metaKeyGitlabUrl, issue.WebURL) if err == nil { - gi.out <- core.NewImportNothing("", "bug already imported") return b, nil } if err != bug.ErrBugNotExist { @@ -299,8 +300,6 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n NOTE_MENTIONED_IN_ISSUE, NOTE_MENTIONED_IN_MERGE_REQUEST: - reason := fmt.Sprintf("unsupported note type: %s", noteType.String()) - gi.out <- core.NewImportNothing("", reason) return nil default: |