mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-27 07:32:45 +08:00
Add Close() method to gogitRepository (#8901)
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
This commit is contained in:
cmd
docs/content/doc/advanced
integrations
api_releases_test.goapi_repo_file_create_test.goapi_repo_file_update_test.goapi_repo_get_contents_list_test.goapi_repo_get_contents_test.goapi_repo_git_tags_test.gorepofiles_delete_test.gorepofiles_update_test.go
models
graph_test.go
migrations
pull.gorepo.gorepo_activity.gorepo_branch.gorepo_sign.gorepo_tag.gowiki.gowiki_test.gomodules
context
git
blame.goblob_test.gocommit_info_test.gonotes_test.gorepo.gorepo_blob_test.gorepo_branch.gorepo_branch_test.gorepo_commit_test.gorepo_compare_test.gorepo_ref_test.gorepo_stats_test.gorepo_tag_test.gorepo_test.gotree_entry_test.go
migrations
notification/webhook
repofiles
action.goblob.goblob_test.gocommit_status.gocontent.gocontent_test.godiff_test.gofile_test.gotemp_repo.gotree.gotree_test.goupdate.go
test
routers
api/v1
repo
services
comments
gitdiff
mirror
pull
release
@ -139,6 +139,7 @@ func TestAPICreateFile(t *testing.T) {
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.HTMLURL, fileResponse.Commit.HTMLURL)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Email, fileResponse.Commit.Author.Email)
|
||||
assert.EqualValues(t, expectedFileResponse.Commit.Author.Name, fileResponse.Commit.Author.Name)
|
||||
gitRepo.Close()
|
||||
}
|
||||
|
||||
// Test creating a file in a new branch
|
||||
|
Reference in New Issue
Block a user