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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3de11e1a
Commit
3de11e1a
authored
Apr 05, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't pass `env` anymore to GitAccess, ChangeAccess, and ForcePush
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ae88355b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
lib/gitlab/checks/change_access.rb
lib/gitlab/checks/change_access.rb
+2
-3
lib/gitlab/checks/force_push.rb
lib/gitlab/checks/force_push.rb
+1
-1
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+1
-3
No files found.
lib/gitlab/checks/change_access.rb
View file @
3de11e1a
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
attr_reader
:user_access
,
:project
,
:skip_authorization
,
:protocol
attr_reader
:user_access
,
:project
,
:skip_authorization
,
:protocol
def
initialize
(
def
initialize
(
change
,
user_access
:,
project
:,
env:
{},
skip_authorization:
false
,
change
,
user_access
:,
project
:,
skip_authorization:
false
,
protocol:
protocol:
)
)
@oldrev
,
@newrev
,
@ref
=
change
.
values_at
(
:oldrev
,
:newrev
,
:ref
)
@oldrev
,
@newrev
,
@ref
=
change
.
values_at
(
:oldrev
,
:newrev
,
:ref
)
...
@@ -13,7 +13,6 @@ module Gitlab
...
@@ -13,7 +13,6 @@ module Gitlab
@tag_name
=
Gitlab
::
Git
.
tag_name
(
@ref
)
@tag_name
=
Gitlab
::
Git
.
tag_name
(
@ref
)
@user_access
=
user_access
@user_access
=
user_access
@project
=
project
@project
=
project
@env
=
env
@skip_authorization
=
skip_authorization
@skip_authorization
=
skip_authorization
@protocol
=
protocol
@protocol
=
protocol
end
end
...
@@ -97,7 +96,7 @@ module Gitlab
...
@@ -97,7 +96,7 @@ module Gitlab
end
end
def
forced_push?
def
forced_push?
Gitlab
::
Checks
::
ForcePush
.
force_push?
(
@project
,
@oldrev
,
@newrev
,
env:
@env
)
Gitlab
::
Checks
::
ForcePush
.
force_push?
(
@project
,
@oldrev
,
@newrev
)
end
end
def
update?
def
update?
...
...
lib/gitlab/checks/force_push.rb
View file @
3de11e1a
module
Gitlab
module
Gitlab
module
Checks
module
Checks
class
ForcePush
class
ForcePush
def
self
.
force_push?
(
project
,
oldrev
,
newrev
,
env:
{}
)
def
self
.
force_push?
(
project
,
oldrev
,
newrev
)
return
false
if
project
.
empty_repo?
return
false
if
project
.
empty_repo?
# Created or deleted branch
# Created or deleted branch
...
...
lib/gitlab/git_access.rb
View file @
3de11e1a
...
@@ -18,13 +18,12 @@ module Gitlab
...
@@ -18,13 +18,12 @@ module Gitlab
attr_reader
:actor
,
:project
,
:protocol
,
:user_access
,
:authentication_abilities
attr_reader
:actor
,
:project
,
:protocol
,
:user_access
,
:authentication_abilities
def
initialize
(
actor
,
project
,
protocol
,
authentication_abilities
:
,
env:
{}
)
def
initialize
(
actor
,
project
,
protocol
,
authentication_abilities
:)
@actor
=
actor
@actor
=
actor
@project
=
project
@project
=
project
@protocol
=
protocol
@protocol
=
protocol
@authentication_abilities
=
authentication_abilities
@authentication_abilities
=
authentication_abilities
@user_access
=
UserAccess
.
new
(
user
,
project:
project
)
@user_access
=
UserAccess
.
new
(
user
,
project:
project
)
@env
=
env
end
end
def
check
(
cmd
,
changes
)
def
check
(
cmd
,
changes
)
...
@@ -152,7 +151,6 @@ module Gitlab
...
@@ -152,7 +151,6 @@ module Gitlab
change
,
change
,
user_access:
user_access
,
user_access:
user_access
,
project:
project
,
project:
project
,
env:
@env
,
skip_authorization:
deploy_key?
,
skip_authorization:
deploy_key?
,
protocol:
protocol
protocol:
protocol
).
exec
).
exec
...
...
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