mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
refactor: remove Ctx field from git.Repository (#38500)
This commit is contained in:
@@ -153,10 +153,10 @@ func TestAPICreateFile(t *testing.T) {
|
||||
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s", user2.Name, repo1.Name, treePath), &createFileOptions).
|
||||
AddTokenAuth(token2)
|
||||
resp := MakeRequest(t, req, http.StatusCreated)
|
||||
gitRepo, _ := gitrepo.OpenRepository(t.Context(), repo1)
|
||||
gitRepo, _ := gitrepo.OpenRepository(repo1)
|
||||
defer gitRepo.Close()
|
||||
commitID, _ := gitRepo.GetBranchCommitID(createFileOptions.NewBranchName)
|
||||
lastCommit, _ := gitRepo.GetCommitByPath(treePath)
|
||||
commitID, _ := gitRepo.GetBranchCommitID(t.Context(), createFileOptions.NewBranchName)
|
||||
lastCommit, _ := gitRepo.GetCommitByPath(t.Context(), treePath)
|
||||
expectedFileResponse := getExpectedFileResponseForCreate(apiFileResponseInfo{
|
||||
repoFullName: "user2/repo1",
|
||||
commitID: commitID,
|
||||
@@ -276,10 +276,10 @@ func TestAPICreateFile(t *testing.T) {
|
||||
AddTokenAuth(token2)
|
||||
resp = MakeRequest(t, req, http.StatusCreated)
|
||||
emptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user2", Name: "empty-repo"}) // public repo
|
||||
gitRepo, _ := gitrepo.OpenRepository(t.Context(), emptyRepo)
|
||||
gitRepo, _ := gitrepo.OpenRepository(emptyRepo)
|
||||
defer gitRepo.Close()
|
||||
commitID, _ := gitRepo.GetBranchCommitID(createFileOptions.NewBranchName)
|
||||
latestCommit, _ := gitRepo.GetCommitByPath(treePath)
|
||||
commitID, _ := gitRepo.GetBranchCommitID(t.Context(), createFileOptions.NewBranchName)
|
||||
latestCommit, _ := gitRepo.GetCommitByPath(t.Context(), treePath)
|
||||
expectedFileResponse := getExpectedFileResponseForCreate(apiFileResponseInfo{
|
||||
repoFullName: "user2/empty-repo",
|
||||
commitID: commitID,
|
||||
|
||||
Reference in New Issue
Block a user