Commit 57d0c185 authored by Timothy Andrew's avatar Timothy Andrew

Fix specs related to gitlab-org/gitlab-ce!5310.

parent 5a4c1aa4
module Gitlab
module Checks
class ChangeAccess
<<<<<<< HEAD
include PathLocksHelper
=======
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
attr_reader :user_access, :project
def initialize(change, user_access:, project:)
......@@ -15,11 +12,7 @@ module Gitlab
end
def exec
<<<<<<< HEAD
error = protected_branch_checks || tag_checks || push_checks || push_rules_checks
=======
error = protected_branch_checks || tag_checks || push_checks
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
if error
GitAccessStatus.new(false, error)
......@@ -68,7 +61,6 @@ module Gitlab
end
end
<<<<<<< HEAD
def push_rules_checks
# Returns nil if all push rule checks passed successfully
# or the error if any hook fails
......@@ -81,8 +73,6 @@ module Gitlab
error
end
=======
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
private
def protected_tag?(tag_name)
......@@ -114,7 +104,6 @@ module Gitlab
nil
end
end
<<<<<<< HEAD
def push_rule_check
return unless project.push_rule && @newrev && @oldrev
......@@ -246,8 +235,6 @@ module Gitlab
# We skip refs/tmp ref because we use it for Web UI commiting
commit.refs(project.repository).reject { |ref| ref.name.start_with?('refs/tmp') }.any?
end
=======
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
end
end
end
......@@ -124,7 +124,6 @@ module Gitlab
private
<<<<<<< HEAD
def commits(newrev, oldrev, project)
if oldrev
project.repository.commits_between(oldrev, newrev)
......@@ -220,14 +219,6 @@ module Gitlab
def geo_node_key
actor if actor.is_a?(GeoNodeKey)
=======
def matching_merge_request?(newrev, branch_name)
Checks::MatchingMergeRequest.new(newrev, branch_name, project).match?
end
def deploy_key
actor if actor.is_a?(DeployKey)
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
end
def deploy_key_can_read_project?
......@@ -249,11 +240,8 @@ module Gitlab
actor
when DeployKey
nil
<<<<<<< HEAD
when GeoNodeKey
nil
=======
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
when Key
actor.user
end
......
module Gitlab
class GitAccessWiki < GitAccess
def change_access_check(change)
<<<<<<< HEAD
if Gitlab::Geo.enabled? && Gitlab::Geo.secondary?
build_status_object(false, "You can't push code to a secondary GitLab Geo node.")
elsif user_access.can_do_action?(:create_wiki)
=======
if user_access.can_do_action?(:create_wiki)
>>>>>>> a27212ab908d5161f5a75b27c4616c11f497f5d4
build_status_object(true)
else
build_status_object(false, "You are not allowed to write to this project's wiki.")
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment