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_notes.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bridge/gitlab/import_notes.go') diff --git a/bridge/gitlab/import_notes.go b/bridge/gitlab/import_notes.go index 06c0a242..85da3158 100644 --- a/bridge/gitlab/import_notes.go +++ b/bridge/gitlab/import_notes.go @@ -30,6 +30,7 @@ const ( func GetNoteType(n *gitlab.Note) (NoteType, string) { // when a note is a comment system is set to false // when a note is a different event system is set to true + // because Gitlab if !n.System { return NOTE_COMMENT, n.Body } @@ -88,6 +89,7 @@ func GetNoteType(n *gitlab.Note) (NoteType, string) { // getNewTitle parses body diff given by gitlab api and return it final form // examples: "changed title from **fourth issue** to **fourth issue{+ changed+}**" // "changed title from **fourth issue{- changed-}** to **fourth issue**" +// because Gitlab func getNewTitle(diff string) string { newTitle := strings.Split(diff, "** to **")[1] newTitle = strings.Replace(newTitle, "{+", "", -1) -- cgit