Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-17 02:14:48 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-17 02:14:48 +0400
commit756b9b59a794ef259007074b4d5718a66a7378d6 (patch)
tree7578624f2dbd631807e9070dcdc29d4647d8a7c6 /app
parent9de8e52d5493b913427708d871613b0609590aa8 (diff)
fix #132
Diffstat (limited to 'app')
-rw-r--r--app/helpers/commits_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 4e7de84fc58..b79e5718194 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -22,10 +22,12 @@ module CommitsHelper
:remote => true, :class => "lite_button vm", :style => "text-align:center; width:930px; ", :id => "more-commits-link"
end
+ # Cause some errors with trucate & encoding use this method
def truncate_commit_message(commit, size = 60)
- truncate(commit.message, :length => size)
+ message = commit.message
+ message.length > size ? (message[0..(size - 1)] + "...") : message
# if special characters occurs
rescue
- commit.message.length > size ? (commit.message[0..(size - 1)] + "...") : commit.message
+ commit.message
end
end