diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-07-23 19:16:52 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-07-23 19:49:53 +0200 |
commit | 29fdd37ce69b48aa9fc3c1b829ff67818041068f (patch) | |
tree | 598301ce5183f5029d58ad40d7dd309dc5799c87 /bridge/gitlab/import.go | |
parent | 0c8f1c3a58c4707284cc6368af26715520a220c0 (diff) | |
download | git-bug-29fdd37ce69b48aa9fc3c1b829ff67818041068f.tar.gz |
bridge/github: add getNewTitle tests
Diffstat (limited to 'bridge/gitlab/import.go')
-rw-r--r-- | bridge/gitlab/import.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index 20c586a7..8f4ceec9 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -138,11 +138,6 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n return err } - hash, errResolve := b.ResolveOperationWithMetadata(keyGitlabId, id) - if errResolve != cache.ErrNoMatchingOp { - return errResolve - } - noteType, body := GetNoteType(note) switch noteType { case NOTE_CLOSED: @@ -189,6 +184,10 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n } case NOTE_COMMENT: + hash, errResolve := b.ResolveOperationWithMetadata(keyGitlabId, id) + if errResolve != cache.ErrNoMatchingOp { + return errResolve + } cleanText, err := text.Cleanup(body) if err != nil { @@ -226,7 +225,7 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n _, err = b.EditCommentRaw( author, note.UpdatedAt.Unix(), - hash, + git.Hash(comment.Id()), cleanText, nil, ) @@ -327,6 +326,7 @@ func (gi *gitlabImporter) ensurePerson(repo *cache.RepoCache, id int) (*cache.Id user.Username, user.AvatarURL, map[string]string{ + // because Gitlab keyGitlabId: strconv.Itoa(id), keyGitlabLogin: user.Username, }, |