Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
This commit is contained in:
parent
889a8c268c
commit
3e88af898a
89 changed files with 176 additions and 170 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue