mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
This commit is contained in:
@@ -109,7 +109,7 @@ func TestGetFileResponseFromCommit(t *testing.T) {
|
||||
repo := ctx.Repo.Repository
|
||||
branch := repo.DefaultBranch
|
||||
treePath := "README.md"
|
||||
gitRepo, _ := git.OpenRepositoryCtx(ctx, repo.RepoPath())
|
||||
gitRepo, _ := git.OpenRepository(ctx, repo.RepoPath())
|
||||
defer gitRepo.Close()
|
||||
commit, _ := gitRepo.GetBranchCommit(branch)
|
||||
expectedFileResponse := getExpectedFileResponse()
|
||||
|
@@ -69,7 +69,7 @@ func (t *TemporaryUploadRepository) Clone(branch string) error {
|
||||
return fmt.Errorf("Clone: %v %s", err, stderr)
|
||||
}
|
||||
}
|
||||
gitRepo, err := git.OpenRepositoryCtx(t.ctx, t.basePath)
|
||||
gitRepo, err := git.OpenRepository(t.ctx, t.basePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func (t *TemporaryUploadRepository) Init() error {
|
||||
if err := git.InitRepository(t.ctx, t.basePath, false); err != nil {
|
||||
return err
|
||||
}
|
||||
gitRepo, err := git.OpenRepositoryCtx(t.ctx, t.basePath)
|
||||
gitRepo, err := git.OpenRepository(t.ctx, t.basePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user