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
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2019-02-08 15:19:53 +0300
committerAndrew Newdigate <andrew@gitlab.com>2019-03-06 18:51:56 +0300
commit3288e1a874ec0184f9f27f932748e51c57babf17 (patch)
tree9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /app/models/repository.rb
parent7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (diff)
Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of `return nil if ...` to save maintainers a few minor review points
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index cd761a29618..851175a61b7 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -79,7 +79,7 @@ class Repository
end
def raw_repository
- return nil unless full_path
+ return unless full_path
@raw_repository ||= initialize_raw_repository
end
@@ -103,7 +103,7 @@ class Repository
end
def commit(ref = nil)
- return nil unless exists?
+ return unless exists?
return ref if ref.is_a?(::Commit)
find_commit(ref || root_ref)