summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-02-23 17:19:28 +0000
committerRobert Speicher <robert@gitlab.com>2017-02-23 17:19:28 +0000
commit170fef0bd34a853bc2499cc7335705f73bc98edb (patch)
treef7af5116b41b7d697f9ac783bc647aba0d2902ab /app/models/commit.rb
parent6a39888344a2478db022fdf8b5e41fd7625d83ab (diff)
parentade5e0b1ba04047c72cb0aff3d635a2cdaaab43c (diff)
downloadgitlab-ce-170fef0bd34a853bc2499cc7335705f73bc98edb.tar.gz
Merge branch 'dm-meer-blauw-op-straat' into 'master'
Enable (and disable) more RuboCops See merge request !9432
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 46f06733da1..0a18986ef26 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -22,12 +22,12 @@ class Commit
DIFF_HARD_LIMIT_LINES = 50000
# The SHA can be between 7 and 40 hex characters.
- COMMIT_SHA_PATTERN = '\h{7,40}'
+ COMMIT_SHA_PATTERN = '\h{7,40}'.freeze
class << self
def decorate(commits, project)
commits.map do |commit|
- if commit.kind_of?(Commit)
+ if commit.is_a?(Commit)
commit
else
self.new(commit, project)
@@ -105,7 +105,7 @@ class Commit
end
def diff_line_count
- @diff_line_count ||= Commit::diff_line_count(raw_diffs)
+ @diff_line_count ||= Commit.diff_line_count(raw_diffs)
@diff_line_count
end
@@ -122,11 +122,12 @@ class Commit
def full_title
return @full_title if @full_title
- if safe_message.blank?
- @full_title = no_commit_message
- else
- @full_title = safe_message.split("\n", 2).first
- end
+ @full_title =
+ if safe_message.blank?
+ no_commit_message
+ else
+ safe_message.split("\n", 2).first
+ end
end
# Returns the commits description