Backport #8901 - Adjusted slightly for 1.9
In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.
This PR adds this Close function and adds the Close functions as necessary.
In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.
Fixes#7947
* [Fix] milestone close timestamp (#8728)
* BugFix: Update closed_date_unix colum on milestone table on close
* use go standart time lib
* make backport work!
* Ensure .ssh dir exists before rewriting public keys
* Ensure .ssh dir exists before appending to authorized_keys
* Log the error because it would be useful to know where it is trying to MkdirAll
* Only try to create RootPath if it's not empty
* Change tests to make it possible to run TestGit with 1.7.2
* Make merge run on 1.7.2
* Fix tracking and staging branch name problem
* Ensure that git 1.7.2 works on tests
* ensure that there is no chance for conflicts
* Fix-up missing merge issues
* Final rm
* Ensure LFS filters run on the tests
* Do not sign commits from temp repo
* Apply suggestions from code review
* Update modules/repofiles/temp_repo.go
* Fix issues/pr list broken when there are many repositories (#8409)
* fix issues/pr list broken when there are many repositories
* remove unused codes
* fix counting error on issues/prs
* keep the old logic
* fix panic
* fix tests
* rm unused import
* feat: highlight issue references with :
e.g. #1287: my commit msg
e.g. ABC-1234: my commit msg
* ref: update model regex to consistent with issueNumericPattern
* test: check highlight issue with : in commits messages
* fix milestone num_issues
* update missing completeness
* only update milestone closed number when closed issue is assigned a new milestone or clear milestone
* fix tests
* fix update milestone num
* fix completeness calculate
* make completeness calucation more clear
* Use correct index when fetching commit status
Signed-off-by: Elias Norberg <elias@aisle.se>
* Compare against base repo to avoid mismatch when merging from fork
Signed-off-by: Elias Norberg <elias@aisle.se>
* Fix pull request commit status in user dashboard list
The current webhook just shows the amount of commits, but misses the actual commit description. While the code is actually there to include the description, it is just not included.
Signed-off-by: Bjoern Petri <bjoern.petri@sundevil.de>
The gitea flags must appear in front of the gitea command. Otherwise
they are ignored.
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
(cherry picked from commit 89648746a5)
* Fix dropTableColumns sqlite implementation
* use droptables and its index dropping support in v78 and v85
* golang-ci fixes
* Add migration from gitea 1.3.3 for sqlite which reveals the droptables bug - thus showing this works
when you use gitea as OAuth2 provider, the /api/v1/user should return
user primary email as identifier, which is unique in OAuth2 clients.
this patch use convert.ToUser replace all u.APIFormat in api requests,
return primary email when caller is yourself or admin.
* only return head: null if source branch was deleted
* add URL into GetPullRequest
* TestPullRequest_APIFormat
* log error if it is not Err(Branch)NotExist
(cherry picked from commit ff85a6331e)