From 29fdd37ce69b48aa9fc3c1b829ff67818041068f Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Tue, 23 Jul 2019 19:16:52 +0200 Subject: bridge/github: add getNewTitle tests --- bridge/gitlab/import.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bridge/gitlab/import.go') 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, }, -- cgit