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
0a4c907c
Commit
0a4c907c
authored
Dec 20, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove oldrev and newrev nil-checks that are now unnecessary
parent
c61cb3b4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
5 deletions
+9
-5
ee/lib/ee/gitlab/checks/push_rules/branch_check.rb
ee/lib/ee/gitlab/checks/push_rules/branch_check.rb
+1
-1
ee/lib/ee/gitlab/checks/push_rules/commit_check.rb
ee/lib/ee/gitlab/checks/push_rules/commit_check.rb
+1
-1
ee/lib/ee/gitlab/checks/push_rules/tag_check.rb
ee/lib/ee/gitlab/checks/push_rules/tag_check.rb
+1
-1
lib/gitlab/checks/base_checker.rb
lib/gitlab/checks/base_checker.rb
+5
-1
lib/gitlab/checks/diff_check.rb
lib/gitlab/checks/diff_check.rb
+1
-1
No files found.
ee/lib/ee/gitlab/checks/push_rules/branch_check.rb
View file @
0a4c907c
...
...
@@ -9,7 +9,7 @@ module EE
LOG_MESSAGE
=
"Checking if branch follows the naming patterns defined by the project..."
.
freeze
def
validate!
return
unless
newrev
&&
oldrev
&&
push_rule
return
unless
push_rule
logger
.
log_timed
(
LOG_MESSAGE
)
do
unless
branch_name_allowed_by_push_rule?
...
...
ee/lib/ee/gitlab/checks/push_rules/commit_check.rb
View file @
0a4c907c
...
...
@@ -13,7 +13,7 @@ module EE
LOG_MESSAGE
=
"Checking if commits follow defined push rules..."
.
freeze
def
validate!
return
unless
newrev
&&
oldrev
&&
push_rule
return
unless
push_rule
commit_validation
=
push_rule
.
commit_validation?
# if newrev is blank, the branch was deleted
...
...
ee/lib/ee/gitlab/checks/push_rules/tag_check.rb
View file @
0a4c907c
...
...
@@ -6,7 +6,7 @@ module EE
module
PushRules
class
TagCheck
<
::
Gitlab
::
Checks
::
BaseChecker
def
validate!
return
unless
newrev
&&
oldrev
&&
push_rule
return
unless
push_rule
logger
.
log_timed
(
"Checking if you are allowed to delete a tag..."
)
do
if
tag_deletion_denied_by_push_rule?
...
...
lib/gitlab/checks/base_checker.rb
View file @
0a4c907c
...
...
@@ -19,12 +19,16 @@ module Gitlab
private
def
creation?
Gitlab
::
Git
.
blank_ref?
(
oldrev
)
end
def
deletion?
Gitlab
::
Git
.
blank_ref?
(
newrev
)
end
def
update?
!
Gitlab
::
Git
.
blank_ref?
(
oldrev
)
&&
!
deletion?
!
creation?
&&
!
deletion?
end
def
updated_from_web?
...
...
lib/gitlab/checks/diff_check.rb
View file @
0a4c907c
...
...
@@ -12,7 +12,7 @@ module Gitlab
}.
freeze
def
validate!
return
if
deletion?
||
newrev
.
nil?
return
if
deletion?
return
unless
should_run_diff_validations?
return
if
commits
.
empty?
...
...
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