BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b9d89463
Commit
b9d89463
authored
Aug 30, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use public_send in destroy_conditionally! helper
As we only override in two places, we could just ask for the value rather than the method name.
parent
07a7801c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
branches.rb
lib/api/branches.rb
+1
-1
helpers.rb
lib/api/helpers.rb
+4
-2
tags.rb
lib/api/tags.rb
+1
-1
No files found.
lib/api/branches.rb
View file @
b9d89463
...
...
@@ -130,7 +130,7 @@ module API
commit
=
user_project
.
repository
.
commit
(
branch
.
dereferenced_target
)
destroy_conditionally!
(
commit
,
last_update
_field: :
authored_date
)
do
destroy_conditionally!
(
commit
,
last_update
d:
commit
.
authored_date
)
do
result
=
DeleteBranchService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:branch
])
...
...
lib/api/helpers.rb
View file @
b9d89463
...
...
@@ -19,8 +19,10 @@ module API
end
end
def
destroy_conditionally!
(
resource
,
last_update_field: :updated_at
)
check_unmodified_since!
(
resource
.
public_send
(
last_update_field
))
def
destroy_conditionally!
(
resource
,
last_updated:
nil
)
last_updated
||=
resource
.
updated_at
check_unmodified_since!
(
last_updated
)
status
204
if
block_given?
...
...
lib/api/tags.rb
View file @
b9d89463
...
...
@@ -70,7 +70,7 @@ module API
commit
=
user_project
.
repository
.
commit
(
tag
.
dereferenced_target
)
destroy_conditionally!
(
commit
,
last_update
_field: :
authored_date
)
do
destroy_conditionally!
(
commit
,
last_update
d:
commit
.
authored_date
)
do
result
=
::
Tags
::
DestroyService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:tag_name
])
...
...
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