mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
This commit is contained in:
@ -35,13 +35,13 @@ type Repository struct {
|
||||
Ctx context.Context
|
||||
}
|
||||
|
||||
// OpenRepository opens the repository at the given path.
|
||||
func OpenRepository(repoPath string) (*Repository, error) {
|
||||
return OpenRepositoryCtx(DefaultContext, repoPath)
|
||||
// openRepositoryWithDefaultContext opens the repository at the given path with DefaultContext.
|
||||
func openRepositoryWithDefaultContext(repoPath string) (*Repository, error) {
|
||||
return OpenRepository(DefaultContext, repoPath)
|
||||
}
|
||||
|
||||
// OpenRepositoryCtx opens the repository at the given path within the context.Context
|
||||
func OpenRepositoryCtx(ctx context.Context, repoPath string) (*Repository, error) {
|
||||
// OpenRepository opens the repository at the given path within the context.Context
|
||||
func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
|
||||
repoPath, err := filepath.Abs(repoPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user