Skip to content

Commit dbf1ddd

Browse files
committed
Revert wrong change in test
1 parent 436e769 commit dbf1ddd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/migrations/gitea_uploader_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ func TestGiteaUploadUpdateGitForPullRequest(t *testing.T) {
236236
//
237237
fromRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
238238
baseRef := "master"
239-
assert.NoError(t, gitrepo.InitRepository(git.DefaultContext, fromRepo))
239+
// this is very different from the real situation. It should be a bare repository for all the Gitea managed repositories
240+
assert.NoError(t, git.InitRepository(git.DefaultContext, fromRepo.RepoPath(), false, fromRepo.ObjectFormatName))
240241
err := git.NewCommand("symbolic-ref").AddDynamicArguments("HEAD", git.BranchPrefix+baseRef).Run(git.DefaultContext, &git.RunOpts{Dir: fromRepo.RepoPath()})
241242
assert.NoError(t, err)
242243
assert.NoError(t, os.WriteFile(filepath.Join(fromRepo.RepoPath(), "README.md"), []byte(fmt.Sprintf("# Testing Repository\n\nOriginally created in: %s", fromRepo.RepoPath())), 0o644))

0 commit comments

Comments
 (0)