diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-12-07 09:30:16 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-12-07 09:30:16 +0000 |
commit | e76559cc69bf53b0ad3317039267019867a826fe (patch) | |
tree | 5ad03384a479de062cb129a15ea8617e2c5284b5 | |
parent | 7d564029e1226e8eb12c2de67124311466170fab (diff) | |
parent | 7d18c4d23637f52fa0fdc3028223f8cd1ec1e072 (diff) | |
download | gitlab-ce-e76559cc69bf53b0ad3317039267019867a826fe.tar.gz |
Merge branch 'sh-truncate-with-periods' into 'master'
Truncate merge request titles with periods instead of ellipsis
Closes #54862
See merge request gitlab-org/gitlab-ce!23558
-rw-r--r-- | app/models/commit.rb | 4 | ||||
-rw-r--r-- | changelogs/unreleased/sh-truncate-with-periods.yml | 5 | ||||
-rw-r--r-- | spec/models/commit_spec.rb | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 2c89da88b9b..a422a0995ff 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -177,7 +177,9 @@ class Commit def title return full_title if full_title.length < 100 - full_title.truncate(81, separator: ' ', omission: '…') + # Use three dots instead of the ellipsis Unicode character because + # some clients show the raw Unicode value in the merge commit. + full_title.truncate(81, separator: ' ', omission: '...') end # Returns the full commits title diff --git a/changelogs/unreleased/sh-truncate-with-periods.yml b/changelogs/unreleased/sh-truncate-with-periods.yml new file mode 100644 index 00000000000..b1c6b4f9cbd --- /dev/null +++ b/changelogs/unreleased/sh-truncate-with-periods.yml @@ -0,0 +1,5 @@ +--- +title: Truncate merge request titles with periods instead of ellipsis +merge_request: 23558 +author: +type: changed diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 2a0039a0635..a2d2d77746d 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -204,7 +204,7 @@ describe Commit do message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.' allow(commit).to receive(:safe_message).and_return(message) - expect(commit.title).to eq('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis…') + expect(commit.title).to eq('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id...') end it "truncates a message with a newline before 80 characters at the newline" do |