mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-01 06:00:36 +00:00
refactor: git repo and relative path handling (#38522)
1. simplify "StorageRepo" code 2. simplify git.OpenRepository code 3. by the way, clean up some unused files in git test fixtures.
This commit is contained in:
@@ -811,7 +811,7 @@ func doCreateAgitFlowPull(dstPath string, ctx *APITestContext, headBranch string
|
||||
return
|
||||
}
|
||||
|
||||
gitRepo, err := git.OpenRepository(dstPath)
|
||||
gitRepo, err := git.OpenRepositoryLocal(dstPath)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer gitRepo.Close()
|
||||
|
||||
@@ -87,7 +87,7 @@ func TestAgitPullPush(t *testing.T) {
|
||||
dstPath := t.TempDir()
|
||||
doGitClone(dstPath, u)(t)
|
||||
|
||||
gitRepo, err := git.OpenRepository(dstPath)
|
||||
gitRepo, err := git.OpenRepositoryLocal(dstPath)
|
||||
assert.NoError(t, err)
|
||||
defer gitRepo.Close()
|
||||
|
||||
@@ -150,7 +150,7 @@ func TestAgitReviewStaleness(t *testing.T) {
|
||||
dstPath := t.TempDir()
|
||||
doGitClone(dstPath, u)(t)
|
||||
|
||||
gitRepo, err := git.OpenRepository(dstPath)
|
||||
gitRepo, err := git.OpenRepositoryLocal(dstPath)
|
||||
assert.NoError(t, err)
|
||||
defer gitRepo.Close()
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ func runTestGitPush(t *testing.T, u *url.URL, gitOperation func(t *testing.T, gi
|
||||
|
||||
doGitAddRemote(gitPath, "origin", u)(t)
|
||||
|
||||
gitRepo, err := git.OpenRepository(gitPath)
|
||||
gitRepo, err := git.OpenRepositoryLocal(gitPath)
|
||||
require.NoError(t, err)
|
||||
defer gitRepo.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user