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
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
lib/api/branches.rb
lib/api/branches.rb
+11
-4
lib/api/tags.rb
lib/api/tags.rb
+11
-4
spec/requests/api/tags_spec.rb
spec/requests/api/tags_spec.rb
+1
-1
No files found.
lib/api/branches.rb
View file @
f0f3f385
...
...
@@ -125,6 +125,12 @@ module API
delete
':id/repository/branches/:branch'
,
requirements:
BRANCH_ENDPOINT_REQUIREMENTS
do
authorize_push_project
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
])
...
...
@@ -132,6 +138,7 @@ module API
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
end
end
end
desc
'Delete all merged branches'
delete
':id/repository/merged_branches'
do
...
...
lib/api/tags.rb
View file @
f0f3f385
...
...
@@ -65,6 +65,12 @@ module API
delete
':id/repository/tags/:tag_name'
,
requirements:
TAG_ENDPOINT_REQUIREMENTS
do
authorize_push_project
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
])
...
...
@@ -72,6 +78,7 @@ module API
render_api_error!
(
result
[
:message
],
result
[
:return_code
])
end
end
end
desc
'Add a release note to a tag'
do
success
Entities
::
Release
...
...
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