add support for archive-upload rpc (#36391)
Add support for fetching archives with `git archive --remote <repo-url>` closes: https://github.com/go-gitea/gitea/issues/23425 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ func TestGitSmartHTTP(t *testing.T) {
|
||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||
testGitSmartHTTP(t, u)
|
||||
testRenamedRepoRedirect(t)
|
||||
testGitArchiveRemote(t, u)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -96,3 +97,10 @@ func testRenamedRepoRedirect(t *testing.T) {
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
assert.Contains(t, resp.Body.String(), "65f1bf27bc3bf70f64657658635e66094edbcb4d\trefs/tags/v1.1")
|
||||
}
|
||||
|
||||
func testGitArchiveRemote(t *testing.T, u *url.URL) {
|
||||
u = u.JoinPath("user27/repo49.git")
|
||||
t.Run("Fetch HEAD archive", doGitRemoteArchive(u.String(), "HEAD"))
|
||||
t.Run("Fetch HEAD archive subpath", doGitRemoteArchive(u.String(), "HEAD", "test"))
|
||||
t.Run("list compression options", doGitRemoteArchive(u.String(), "--list"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user