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
When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil,
go gets really unhappy.
Partial backport without changes to locale files.
Fix#8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
* 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
* Add logging for when user requested attachment doesn't belong to the specified release.
* Fix API to use correct variable for release asset (attachment)
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.
* Fixes#7474 - Handles all redirects for Web UI File CRUD
* Fixes lint errors
* Typo fix
* Adds unit tests for a few helper functions
* Fixes per review
* Fix for new branch creation and to unit test
* Fixes the template used for errors on delete
Previously, only the first return value of ctx.GetSuperSecureCookie
was used to check whether decryption of the auth cookie succeeded.
ctx.GetSuperSecureCookie also returns a second value, a boolean,
indicating success or not. That value should be checked first to
be on the safe side and not rely on internal logic of the encryption
and decryption blackbox.
* Fix#6946 by checking PullRequest ID on pushing
* Ensure we have the owner name, the pr attributes and the the issue
* Fix TestSearchRepo by waiting till indexing is done
* Update integrations/repo_search_test.go
* changes as per @mrsdizzie
* missing comma
* Spelling mistake
* Fix full pushing environment
* Show Pull Request button or status of latest PR in branch list
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Do not show pull request button on deleted branches
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Do not show commit divergence on deleted branches
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Use XORMs Get instead of limit
* Links pull request ID and use smaller labels for displaying the pull request status
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Handle error when getting latest pull request
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Indent template
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Check error when loading issue
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
On merge we walk the merge history and ensure that all lfs objects pointed to in
the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)