Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branch delete to API #11112

Merged
merged 7 commits into from
Apr 19, 2020
Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Apr 17, 2020

as title

DELETE /repos/{owner}/{repo}/branches/{branch}

added default branch delete protection to UI function too (should be prefented by template but now go-code take care of it too) -> #11115

close #11070

@6543 6543 force-pushed the add-api-delete-branch_11070 branch from c1a64b7 to 95a6b84 Compare April 17, 2020 22:02
@techknowlogick techknowlogick added this to the 1.12.0 milestone Apr 18, 2020
@techknowlogick techknowlogick added modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality type/feature Completely new functionality. Can only be merged if feature freeze is not active. and removed type/enhancement An improvement of existing functionality labels Apr 18, 2020
routers/api/v1/api.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 18, 2020
@6543
Copy link
Member Author

6543 commented Apr 18, 2020

@guillep2k done

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 18, 2020
@codecov-io
Copy link

codecov-io commented Apr 18, 2020

Codecov Report

Merging #11112 into master will increase coverage by 0.01%.
The diff coverage is 58.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11112      +/-   ##
==========================================
+ Coverage   43.42%   43.44%   +0.01%     
==========================================
  Files         600      600              
  Lines       85022    85108      +86     
==========================================
+ Hits        36922    36972      +50     
- Misses      43541    43567      +26     
- Partials     4559     4569      +10     
Impacted Files Coverage Δ
routers/api/v1/repo/branch.go 51.41% <57.64%> (+0.96%) ⬆️
routers/api/v1/api.go 76.50% <100.00%> (+0.03%) ⬆️
modules/indexer/stats/db.go 40.62% <0.00%> (-28.13%) ⬇️
modules/indexer/stats/queue.go 62.50% <0.00%> (-18.75%) ⬇️
modules/git/utils.go 65.67% <0.00%> (-4.48%) ⬇️
modules/git/repo.go 49.79% <0.00%> (-0.84%) ⬇️
models/repo_list.go 76.51% <0.00%> (-0.81%) ⬇️
services/pull/temp_repo.go 34.18% <0.00%> (+2.56%) ⬆️
modules/git/command.go 89.56% <0.00%> (+2.60%) ⬆️
services/pull/patch.go 65.73% <0.00%> (+2.79%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ef11ff...fb1dff8. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 19, 2020
@lunny lunny merged commit 3c5a4d0 into go-gitea:master Apr 19, 2020
@6543 6543 deleted the add-api-delete-branch_11070 branch April 19, 2020 09:12
@zeripath zeripath changed the title [API] Add branch delete Add branch delete to API Apr 19, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* use same process as in routers/repo/branch.go/deleteBranch

* make sure default branch can not be deleted

* remove IsDefaultBranch from UI process - it is worth its own pull

* permissions
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] [API] to delete a branch
6 participants