You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules
Terence Le Huu Phuong 141d52cc0f
Add API Endpoint for Branch Creation (#11607)
* [FEATURE] [API] Add Endpoint for Branch Creation

Issue: https://github.com/go-gitea/gitea/issues/11376

This commit introduces an API endpoint for branch creation.

The added route is POST /repos/{owner}/{repo}/branches.
A JSON with the name of the new branch and the name of the old branch is
required as parameters.

Signed-off-by: Terence Le Huu Phuong <terence@qwasar.io>

* Put all the logic into CreateBranch and removed CreateRepoBranch

* - Added the error ErrBranchDoesNotExist in error.go
- Made the CreateNewBranch function return an errBranchDoesNotExist error
when the OldBranch does not exist
- Made the CreateBranch API function checks that the repository is not
empty and that branch exists.

* - Added a resetFixtures helper function in integration_test.go to
fine-tune test env resetting
- Added api test for CreateBranch
- Used resetFixture instead of the more general prepareTestEnv in the
repo_branch_test CreateBranch tests

* Moved the resetFixtures call inside the loop for APICreateBranch function

* Put the prepareTestEnv back in repo_branch_test

* fix import order/sort api branch test

Co-authored-by: zeripath <art27@cantab.net>
4 years ago
..
analyze Exclude generated files from language statistics (#11653) 4 years ago
auth Refactor Cron and merge dashboard tasks (#10745) 4 years ago
avatar Improve handling of non-square avatars (#7025) 5 years ago
base Add gitea-vet (#10948) 4 years ago
cache make avatar lookup occur at image request (#10540) 4 years ago
charset deps: update and fix chardet import (#9351) 5 years ago
context Return json on 500 error from API (#11574) 4 years ago
convert API PullReviewComment HTMLPullURL should return the HTMLURL (#11501) 4 years ago
cron Refactor Cron and merge dashboard tasks (#10745) 4 years ago
emoji Update emoji regex (#11584) 4 years ago
eventsource Add EventSource support (#11235) 4 years ago
generate Add gitea-vet (#10948) 4 years ago
git Exclude generated files from language statistics (#11653) 4 years ago
gitgraph Move git graph from models to modules/graph (#9027) 5 years ago
graceful Handle panics that percolate up to the graceful module (#11291) 4 years ago
highlight Add a lot of extension to language mappings for syntax highlights (#7741) 5 years ago
httplib Add golangci (#6418) 5 years ago
indexer Log the indexer path on failure (#11172) 4 years ago
lfs Support Range header end in lfs (#11314) 4 years ago
log modules/log: remove noop written variables (#10182) 4 years ago
markup Update emoji regex (#11584) 4 years ago
metrics Prometheus endpoint (#5256) 6 years ago
migrations Refactor Cron and merge dashboard tasks (#10745) 4 years ago
notification Add push commits history comment on PR time-line (#11167) 4 years ago
options Rename scripts to build and add revive command as a new build tool command (#10942) 4 years ago
password Add password requirement info on error (#9074) 5 years ago
pprof Add golangci (#6418) 5 years ago
private Upgrade golangci-lint to 1.24.0 (#10894) 4 years ago
process Add gitea-vet (#10948) 4 years ago
public Send 404 immediately for known public requests (#11117) 4 years ago
queue Prevent timer leaks in Workerpool and others (#11333) 4 years ago
recaptcha fixed reCAPTCHA URL (#9083) 5 years ago
references Accept punctuation after simple+cross repository issue references (#10091) 4 years ago
repofiles Fix numbr of files, total additions, and deletions (#11614) 4 years ago
repository Add API Endpoint for Branch Creation (#11607) 4 years ago
secret Integrate OAuth2 Provider (#5378) 5 years ago
session Prevent (caught) panic on login (#11590) 4 years ago
setting Default MSSQL port 0 to allow automatic detection by default (#11642) 4 years ago
ssh log.Fatal on failure to listen to SSH port (#10795) 4 years ago
structs Add API Endpoint for Branch Creation (#11607) 4 years ago
sync Fix missing unlock in uniquequeue (#9790) 5 years ago
task Move create/fork repository from models to modules/repository (#9489) 5 years ago
templates Move serviceworker to workbox and fix SSE interference (#11538) 4 years ago
test Add Organization Wide Labels (#10814) 4 years ago
timeutil Use gitea forked macaron (#7933) 5 years ago
upload Fix upload file type check (#7890) 5 years ago
user Add gitea-vet (#10948) 4 years ago
util Prevent timer leaks in Workerpool and others (#11333) 4 years ago
validation [API] Get a single commit via Ref (#10915) 4 years ago
webhook Handle panics that percolate up to the graceful module (#11291) 4 years ago