summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 08:37:28 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 08:37:28 -0700
commiteda120dc4d8599e293afec7789847fd22ca0c1b0 (patch)
treeff008fc6295433fe6f54f62b89c18dd92b89a278 /lib
parentd554070a62b0bc34ab2289d4a071b950df4d5485 (diff)
parentf729f6044717635ca2dfbe054fa863d068de5c98 (diff)
downloadgitlab-ce-eda120dc4d8599e293afec7789847fd22ca0c1b0.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb4
-rw-r--r--lib/gitlab/git_access.rb2
-rw-r--r--lib/gitlab/popen.rb2
-rw-r--r--lib/gitlab/satellite/merge_action.rb2
-rw-r--r--lib/gitlab/theme.rb2
5 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index a6e77002a01..be133a2920b 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -20,7 +20,7 @@ module API
identifier = sudo_identifier()
# If the sudo is the current user do nothing
- if (identifier && !(@current_user.id == identifier || @current_user.username == identifier))
+ if identifier && !(@current_user.id == identifier || @current_user.username == identifier)
render_api_error!('403 Forbidden: Must be admin to use sudo', 403) unless @current_user.is_admin?
@current_user = User.by_username_or_id(identifier)
not_found!("No user id or username for: #{identifier}") if @current_user.nil?
@@ -33,7 +33,7 @@ module API
identifier ||= params[SUDO_PARAM] ||= env[SUDO_HEADER]
# Regex for integers
- if (!!(identifier =~ /^[0-9]+$/))
+ if !!(identifier =~ /^[0-9]+$/)
identifier.to_i
else
identifier
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index d6e609e2c44..bc72b7528d5 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -30,7 +30,7 @@ module Gitlab
def can_push_to_branch?(ref)
return false unless user
-
+
if project.protected_branch?(ref) &&
!(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user))
user.can?(:push_code_to_protected_branches, project)
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb
index fea4d2d55d2..43e07e09160 100644
--- a/lib/gitlab/popen.rb
+++ b/lib/gitlab/popen.rb
@@ -29,7 +29,7 @@ module Gitlab
@cmd_status = wait_thr.value.exitstatus
end
- return @cmd_output, @cmd_status
+ [@cmd_output, @cmd_status]
end
end
end
diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb
index 25122666f5e..1f2e5f82dd5 100644
--- a/lib/gitlab/satellite/merge_action.rb
+++ b/lib/gitlab/satellite/merge_action.rb
@@ -97,7 +97,7 @@ module Gitlab
in_locked_and_timed_satellite do |merge_repo|
prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo)
- if (merge_request.for_fork?)
+ if merge_request.for_fork?
repository = Gitlab::Git::Repository.new(merge_repo.path)
commits = Gitlab::Git::Commit.between(
repository,
diff --git a/lib/gitlab/theme.rb b/lib/gitlab/theme.rb
index 9799e54de5d..43093c7d27e 100644
--- a/lib/gitlab/theme.rb
+++ b/lib/gitlab/theme.rb
@@ -19,7 +19,7 @@ module Gitlab
id ||= Gitlab.config.gitlab.default_theme
- return themes[id]
+ themes[id]
end
def self.type_css_class_by_id(id)