summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/branch.go
Commit message (Collapse)AuthorAgeFilesLines
* Move some helper files out of models (#19355)Lunny Xiao2022-05-081-1/+1
| | | | | | | * Move some helper files out of models * Some improvements Co-authored-by: delvh <dev.lh@web.de>
* more context for models (#19511)65432022-04-281-1/+1
| | | | | make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
* Make git.OpenRepository accept Context (#19260)65432022-03-301-1/+1
| | | | | * OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
* Renamed ctx.User to ctx.Doer. (#19161)KN4CK3R2022-03-221-8/+8
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Lock gofumpt to v0.3.0 and run it (#18866)silverwind2022-02-231-1/+2
| | | | | We can't depend on `latest` version of gofumpt because the output will not be stable across versions. Lock it down to the latest version released yesterday and run it again.
* format with gofumpt (#18184)65432022-01-201-1/+1
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Propagate context and ensure git commands run in request context (#17868)zeripath2022-01-191-5/+5
| | | | | | | | | This PR continues the work in #17125 by progressively ensuring that git commands run within the request context. This now means that the if there is a git repo already open in the context it will be used instead of reopening it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Handle missing default branch better in owner/repo/branches page (#18290)zeripath2022-01-161-20/+33
| | | | | | | This PR more nicely handles a missing default branch in owner/repo/branches Fix #18265 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor HTTP request context (#17979)wxiaoguang2021-12-151-1/+1
|
* Some repository refactors (#17950)Lunny Xiao2021-12-121-1/+1
| | | | | | | | | * some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
* Move repository model into models/repo (#17933)Lunny Xiao2021-12-101-5/+6
| | | | | | | | | | | | | | | * Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
* Improve checkBranchName (#17901)zeripath2021-12-081-2/+2
| | | | | | | | | | | | The current implementation of checkBranchName is highly inefficient involving opening the repository, the listing all of the branch names checking them individually before then using using opened repo to get the tags. This PR avoids this by simply walking the references from show-ref instead of opening the repository (in the nogogit case). Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make Requests Processes and create process hierarchy. Associate ↵zeripath2021-11-301-1/+1
| | | | | | | | | OpenRepository with context. (#17125) This PR registers requests with the process manager and manages hierarchy within the processes. Git repos are then associated with a context, (usually the request's context) - with sub commands using this context as their base context. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move repofiles from modules/repofiles to services/repository/files (#17774)Lunny Xiao2021-11-241-3/+3
| | | | | | | | | * Move repofiles from modules to services * rename services/repository/repofiles -> services/repository/files * Fix test Co-authored-by: 6543 <6543@obermui.de>
* Remove unnecessary attributes of User struct (#17745)Lunny Xiao2021-11-221-1/+2
| | | | | | | | | | | | | | | * Remove unnecessary functions of User struct * Move more database methods out of user struct * Move more database methods out of user struct * Fix template failure * Fix bug * Remove finished FIXME * remove unnecessary code
* Fixed commit count. (#17698)KN4CK3R2021-11-171-7/+5
| | | | Added "Tag" label. Unified branch, tag and commit name.
* Move some functions into services/repository (#17677)Lunny Xiao2021-11-171-4/+4
|
* Move unit into models/unit/ (#17576)Lunny Xiao2021-11-091-3/+4
| | | | | * Move unit into models/unit/ * Rename unit.UnitType as unit.Type
* Fix branch pagination error (#16805)Lunny Xiao2021-08-241-1/+1
| | | | | Fix #16801 Even if default branch is removed from the current page, but the total branches number should be still kept. So that the pagination calculation will be correct.
* Rename ctx.Form() to ctx.FormString() and move code into own file (#16571)65432021-08-111-2/+2
| | | | | | | Followup from #16562 prepare for #16567 * Rename ctx.Form() to ctx.FormString() * Reimplement FormX func to need less code and cpu cycles * Move code into own file
* Rename context.Query to context.Form (#16562)Lunny Xiao2021-07-291-5/+5
|
* Let package git depend on setting but not opposite (#15241)Lunny Xiao2021-06-261-3/+4
| | | | | * Let package git depend on setting but not opposite * private some package variables
* Refactor routers directory (#15800)Lunny Xiao2021-06-091-0/+407
* refactor routers directory * move func used for web and api to common * make corsHandler a function to prohibit side efects * rm unused func Co-authored-by: 6543 <6543@obermui.de>