mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-04 09:04:44 +00:00
refactor!: remove go-git backend (#39487)
Removes the go-git backend so every build uses the git CLI backend. Its Windows performance advantage is gone, it lacks SHA-256 support, and it breaks repositories on Windows. The performance changes moved to https://github.com/go-gitea/gitea/pull/39526. Fixes https://github.com/go-gitea/gitea/issues/38359 Fixes https://github.com/go-gitea/gitea/issues/34694 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -57,15 +57,13 @@ func TestAPIGitTags(t *testing.T) {
|
||||
assert.Equal(t, user.Email, tag.Tagger.Email)
|
||||
assert.Equal(t, repo.APIURL()+"/git/tags/"+aTag.ID.String(), tag.URL)
|
||||
|
||||
if !git.DefaultFeatures().UsingGogit {
|
||||
defer test.MockVariableValue(&git.MaxGitObjectSize, 1024)()
|
||||
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/tags/%s", user.Name, repo.Name, aTag.ID.String()).AddTokenAuth(token)
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
tag = DecodeJSON(t, resp, &api.AnnotatedTag{})
|
||||
assert.True(t, strings.HasPrefix(aTagMessage, tag.Message))
|
||||
assert.Less(t, len(tag.Message), len(aTagMessage))
|
||||
assert.Less(t, len(tag.Message), 1024)
|
||||
}
|
||||
defer test.MockVariableValue(&git.MaxGitObjectSize, 1024)()
|
||||
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/tags/%s", user.Name, repo.Name, aTag.ID.String()).AddTokenAuth(token)
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
tag = DecodeJSON(t, resp, &api.AnnotatedTag{})
|
||||
assert.True(t, strings.HasPrefix(aTagMessage, tag.Message))
|
||||
assert.Less(t, len(tag.Message), len(aTagMessage))
|
||||
assert.Less(t, len(tag.Message), 1024)
|
||||
|
||||
// Should NOT work for lightweight tags
|
||||
badReq := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/tags/%s", user.Name, repo.Name, commit.ID.String()).
|
||||
|
||||
Reference in New Issue
Block a user