Browse Source
Add Close() method to gogitRepository (#8901) (#8956)
Add Close() method to gogitRepository (#8901) (#8956)
Backport #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 #7947release/v1.10
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 386 additions and 102 deletions
-
3cmd/admin.go
-
3docs/content/doc/advanced/migrations.en-us.md
-
2integrations/api_releases_test.go
-
1integrations/api_repo_file_create_test.go
-
1integrations/api_repo_file_update_test.go
-
2integrations/api_repo_get_contents_list_test.go
-
2integrations/api_repo_get_contents_test.go
-
2integrations/api_repo_git_tags_test.go
-
5integrations/repofiles_delete_test.go
-
18integrations/repofiles_update_test.go
-
1models/graph_test.go
-
1models/migrations/v39.go
-
1models/migrations/v82.go
-
5models/pull.go
-
1models/repo.go
-
4models/repo_activity.go
-
4models/repo_branch.go
-
24models/repo_tag.go
-
2models/wiki.go
-
3models/wiki_test.go
-
9modules/context/api.go
-
19modules/context/repo.go
-
3modules/git/blame.go
-
4modules/git/blob_test.go
-
10modules/git/commit_info_test.go
-
2modules/git/notes_test.go
-
16modules/git/repo.go
-
3modules/git/repo_blob_test.go
-
1modules/git/repo_branch.go
-
2modules/git/repo_branch_test.go
-
3modules/git/repo_commit_test.go
-
1modules/git/repo_compare_test.go
-
2modules/git/repo_ref_test.go
-
1modules/git/repo_stats_test.go
-
3modules/git/repo_tag_test.go
-
1modules/git/repo_test.go
-
1modules/git/tree_entry_test.go
-
1modules/migrations/base/uploader.go
-
7modules/migrations/gitea.go
-
1modules/migrations/migrate.go
-
6modules/repofiles/action.go
-
1modules/repofiles/blob.go
-
2modules/repofiles/blob_test.go
-
2modules/repofiles/commit_status.go
-
2modules/repofiles/content.go
-
12modules/repofiles/content_test.go
-
4modules/repofiles/diff_test.go
-
3modules/repofiles/file_test.go
-
1modules/repofiles/temp_repo.go
-
1modules/repofiles/tree.go
-
2modules/repofiles/tree_test.go
-
1modules/repofiles/update.go
-
1modules/test/context_tests.go
-
2routers/api/v1/api.go
-
2routers/api/v1/repo/commits.go
-
1routers/api/v1/repo/file.go
-
2routers/api/v1/repo/git_ref.go
-
7routers/api/v1/repo/pull.go
-
2routers/api/v1/repo/tag.go
-
8routers/repo/compare.go
-
5routers/repo/editor_test.go
-
6routers/repo/pull.go
-
1routers/repo/release_test.go
-
10routers/repo/setting.go
-
70routers/repo/wiki.go
-
1routers/repo/wiki_test.go
-
1services/comments/comments.go
-
2services/gitdiff/gitdiff.go
-
152services/mirror/mirror.go
-
1services/mirror/mirror_test.go
-
1services/pull/commit_status.go
-
1services/release/release_test.go
@ -1,24 +0,0 @@ |
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|||
// Use of this source code is governed by a MIT-style
|
|||
// license that can be found in the LICENSE file.
|
|||
|
|||
package models |
|||
|
|||
import ( |
|||
"code.gitea.io/gitea/modules/git" |
|||
) |
|||
|
|||
// GetTagsByPath returns repo tags by its path
|
|||
func GetTagsByPath(path string) ([]*git.Tag, error) { |
|||
gitRepo, err := git.OpenRepository(path) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
|
|||
return gitRepo.GetTagInfos() |
|||
} |
|||
|
|||
// GetTags return repo's tags
|
|||
func (repo *Repository) GetTags() ([]*git.Tag, error) { |
|||
return GetTagsByPath(repo.RepoPath()) |
|||
} |