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
f0f3f385
Commit
f0f3f385
authored
Mar 02, 2017
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use commit date for branches and tags
parent
e80313f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
branches.rb
lib/api/branches.rb
+11
-4
tags.rb
lib/api/tags.rb
+11
-4
tags_spec.rb
spec/requests/api/tags_spec.rb
+1
-1
No files found.
lib/api/branches.rb
View file @
f0f3f385
...
...
@@ -125,11 +125,18 @@ module API
delete
':id/repository/branches/:branch'
,
requirements:
BRANCH_ENDPOINT_REQUIREMENTS
do
authorize_push_project
result
=
DeleteBranchService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:branch
])
branch
=
user_project
.
repository
.
find_branch
(
params
[
:branch
])
not_found!
(
'Branch'
)
unless
branch
commit
=
user_project
.
repository
.
commit
(
branch
.
dereferenced_target
)
destroy_conditionally!
(
commit
,
last_update_field: :authored_date
)
do
result
=
DeleteBranchService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:branch
])
if
result
[
:status
]
!=
:success
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
if
result
[
:status
]
!=
:success
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
end
end
end
...
...
lib/api/tags.rb
View file @
f0f3f385
...
...
@@ -65,11 +65,18 @@ module API
delete
':id/repository/tags/:tag_name'
,
requirements:
TAG_ENDPOINT_REQUIREMENTS
do
authorize_push_project
result
=
::
Tags
::
DestroyService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:tag_name
])
tag
=
user_project
.
repository
.
find_tag
(
params
[
:tag_name
])
not_found!
(
'Tag'
)
unless
tag
commit
=
user_project
.
repository
.
commit
(
tag
.
dereferenced_target
)
destroy_conditionally!
(
commit
,
last_update_field: :authored_date
)
do
result
=
::
Tags
::
DestroyService
.
new
(
user_project
,
current_user
)
.
execute
(
params
[
:tag_name
])
if
result
[
:status
]
!=
:success
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
if
result
[
:status
]
!=
:success
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
end
end
end
...
...
spec/requests/api/tags_spec.rb
View file @
f0f3f385
...
...
@@ -394,7 +394,7 @@ describe API::Tags do
it_behaves_like
'404 response'
do
let
(
:request
)
{
put
api
(
route
,
current_user
),
description:
new_description
}
let
(
:message
)
{
'
404 Tag Not Found
'
}
let
(
:message
)
{
'
Tag does not exist
'
}
end
end
...
...
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