|
5 | 5 | package integrations |
6 | 6 |
|
7 | 7 | import ( |
| 8 | + stdCtx "context" |
8 | 9 | "encoding/base64" |
9 | 10 | "fmt" |
10 | 11 | "net/http" |
@@ -167,7 +168,7 @@ func TestAPICreateFile(t *testing.T) { |
167 | 168 | url := fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2) |
168 | 169 | req := NewRequestWithJSON(t, "POST", url, &createFileOptions) |
169 | 170 | resp := session.MakeRequest(t, req, http.StatusCreated) |
170 | | - gitRepo, _ := git.OpenRepository(repo1.RepoPath()) |
| 171 | + gitRepo, _ := git.OpenRepository(stdCtx.Background(), repo1.RepoPath()) |
171 | 172 | commitID, _ := gitRepo.GetBranchCommitID(createFileOptions.NewBranchName) |
172 | 173 | expectedFileResponse := getExpectedFileResponseForCreate("user2/repo1", commitID, treePath) |
173 | 174 | var fileResponse api.FileResponse |
@@ -286,7 +287,7 @@ func TestAPICreateFile(t *testing.T) { |
286 | 287 | req = NewRequestWithJSON(t, "POST", url, &createFileOptions) |
287 | 288 | resp = session.MakeRequest(t, req, http.StatusCreated) |
288 | 289 | emptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user2", Name: "empty-repo"}).(*repo_model.Repository) // public repo |
289 | | - gitRepo, _ := git.OpenRepository(emptyRepo.RepoPath()) |
| 290 | + gitRepo, _ := git.OpenRepository(stdCtx.Background(), emptyRepo.RepoPath()) |
290 | 291 | commitID, _ := gitRepo.GetBranchCommitID(createFileOptions.NewBranchName) |
291 | 292 | expectedFileResponse := getExpectedFileResponseForCreate("user2/empty-repo", commitID, treePath) |
292 | 293 | DecodeJSON(t, resp, &fileResponse) |
|
0 commit comments