diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-05-20 16:23:04 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-05-20 16:23:04 -0500 |
commit | fc1910ddc5db25e608921f69c3dc28d830e6ea03 (patch) | |
tree | 1f82bd43de18fdb6ec1d01801d7d75c08bdf7928 /app/services | |
parent | 63f53730c0483b4c9e6fa9d90413d40a8c74a243 (diff) | |
parent | 5341b16fc92425d557a1c62d0329b276170eba73 (diff) | |
download | gitlab-ce-fc1910ddc5db25e608921f69c3dc28d830e6ea03.tar.gz |
Merge branch 'adambutler/gitlab-ce-feature/support-diff-of-issue-title-rename'
# Conflicts:
# app/services/system_note_service.rb
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/system_note_service.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 972f8b2012d..4e8fa0818b9 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -169,7 +169,14 @@ class SystemNoteService # # Returns the created Note object def self.change_title(noteable, project, author, old_title) - body = "Title changed from **#{old_title}** to **#{noteable.title}**" + new_title = noteable.title.dup + + old_diffs, new_diffs = Gitlab::Diff::InlineDiff.new(old_title, new_title).inline_diffs + + marked_old_title = Gitlab::Diff::InlineDiffMarker.new(old_title).mark(old_diffs, mode: :deletion, markdown: true) + marked_new_title = Gitlab::Diff::InlineDiffMarker.new(new_title).mark(new_diffs, mode: :addition, markdown: true) + + body = "Changed title: **#{marked_old_title}** → **#{marked_new_title}**" create_note(noteable: noteable, project: project, author: author, note: body) end |