diff options
author | Rémy Coutable <remy@rymai.me> | 2016-12-13 19:15:07 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-12-13 19:15:07 +0000 |
commit | 75f9c98930d7eceb1458898c2e0633fe0768096f (patch) | |
tree | f68a10efc6d07394d826d26b6bc24a3c92de121e | |
parent | e3231cc2979a1d4ab9b6865f9e2b6494f17b5d9b (diff) | |
parent | 549242c620a812b4ed0f1a3b08f3e315027b9e65 (diff) | |
download | gitlab-ce-75f9c98930d7eceb1458898c2e0633fe0768096f.tar.gz |
Merge branch 'jzinn/gitlab-ce-chomp-git-status-message' into 'master'
For single line Git commit messages, the close quote should be on the same line as the open quote
_Originally opened at !7299 by @jzinn._
- - -
## What does this MR do?
Chomps merge commit messages so that there is not a dangling close quote.
A better solution would be not to use quotes at all, but to set off the message in a `<div>` with a background color.
## Screenshots (if relevant)
![Screen_Shot_2016-11-04_at_8.06.54_PM](/uploads/6e749c5227d88a9bfea64e70cccaf14a/Screen_Shot_2016-11-04_at_8.06.54_PM.png)
See merge request !7975
-rw-r--r-- | app/models/project_services/jira_service.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/chomp-git-status-message.yml | 5 | ||||
-rw-r--r-- | spec/services/system_note_service_spec.rb | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb index 894315a8593..2d969d2fcb6 100644 --- a/app/models/project_services/jira_service.rb +++ b/app/models/project_services/jira_service.rb @@ -220,7 +220,7 @@ class JiraService < IssueTrackerService entity_title = data[:entity][:title] project_name = data[:project][:name] - message = "[#{user_name}|#{user_url}] mentioned this issue in [a #{entity_name} of #{project_name}|#{entity_url}]:\n'#{entity_title}'" + message = "[#{user_name}|#{user_url}] mentioned this issue in [a #{entity_name} of #{project_name}|#{entity_url}]:\n'#{entity_title.chomp}'" link_title = "GitLab: Mentioned on #{entity_name} - #{entity_title}" link_props = build_remote_link_props(url: entity_url, title: link_title) diff --git a/changelogs/unreleased/chomp-git-status-message.yml b/changelogs/unreleased/chomp-git-status-message.yml new file mode 100644 index 00000000000..f70607df7a1 --- /dev/null +++ b/changelogs/unreleased/chomp-git-status-message.yml @@ -0,0 +1,5 @@ +--- +title: For single line git commit messages, the close quote should be on the same + line as the open quote +merge_request: +author: diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 90b7e62bc6f..0e8adb68721 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -694,7 +694,7 @@ describe SystemNoteService, services: true do describe "existing reference" do before do - message = "[#{author.name}|http://localhost/#{author.username}] mentioned this issue in [a commit of #{project.path_with_namespace}|http://localhost/#{project.path_with_namespace}/commit/#{commit.id}]:\n'#{commit.title}'" + message = "[#{author.name}|http://localhost/#{author.username}] mentioned this issue in [a commit of #{project.path_with_namespace}|http://localhost/#{project.path_with_namespace}/commit/#{commit.id}]:\n'#{commit.title.chomp}'" allow_any_instance_of(JIRA::Resource::Issue).to receive(:comments).and_return([OpenStruct.new(body: message)]) end |