Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
57d0c185
Commit
57d0c185
authored
Jul 19, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs related to gitlab-org/gitlab-ce!5310.
parent
5a4c1aa4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
236 deletions
+88
-236
lib/gitlab/checks/change_access.rb
lib/gitlab/checks/change_access.rb
+0
-13
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+0
-12
lib/gitlab/git_access_wiki.rb
lib/gitlab/git_access_wiki.rb
+0
-4
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+88
-207
No files found.
lib/gitlab/checks/change_access.rb
View file @
57d0c185
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
lib/gitlab/git_access.rb
View file @
57d0c185
...
...
@@ -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
...
...
lib/gitlab/git_access_wiki.rb
View file @
57d0c185
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."
)
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
57d0c185
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment