summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/helpers/commits_helper.rb4
-rw-r--r--app/views/commits/_commit.html.haml3
3 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2e4121c..1ccf229 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,5 @@
v7.14.0 (unreleased)
+ - Truncate commit messages after subject line in table
- Adjust CI config to support Docker executors
v7.13.1
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index b94cfaf..37a9f34 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -15,4 +15,8 @@ module CommitsHelper
def commit_link(commit)
link_to(commit.short_sha, project_ref_commit_path(commit.project, commit.ref, commit.sha))
end
+
+ def truncate_first_line(message, length = 50)
+ truncate(message.lines.first.chomp, length: length)
+ end
end
diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml
index 7fae74e..a273f09 100644
--- a/app/views/commits/_commit.html.haml
+++ b/app/views/commits/_commit.html.haml
@@ -11,7 +11,7 @@
%strong #{commit.short_sha}
%td.build-message
- %span= truncate(commit.git_commit_message, length: 50)
+ %span= truncate_first_line(commit.git_commit_message)
%td.build-branch
- unless @ref
@@ -30,4 +30,3 @@
%td.coverage
- if commit.coverage
#{commit.coverage}%
-