aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-01-31 18:03:11 +0800
committerGitHub <noreply@github.com>2025-01-31 18:03:11 +0800
commit4f3cc26b4e8dfffedd523bc18a93a04aaf458337 (patch)
treeb30fe567a4312941adf01cc9a288a15fe4c02963
parent05e9063013b91a7e78ab5f2b97dc7f65ee687436 (diff)
downloadgitea-4f3cc26b4e8dfffedd523bc18a93a04aaf458337.tar.gz
gitea-4f3cc26b4e8dfffedd523bc18a93a04aaf458337.zip
Revert empty lfs ref name (#33454)
Fix #33453
-rw-r--r--modules/lfs/http_client.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/lfs/http_client.go b/modules/lfs/http_client.go
index 3acd23b8f7..0a27fb0c86 100644
--- a/modules/lfs/http_client.go
+++ b/modules/lfs/http_client.go
@@ -72,10 +72,14 @@ func (c *HTTPClient) batch(ctx context.Context, operation string, objects []Poin
url := fmt.Sprintf("%s/objects/batch", c.endpoint)
+ // Original: In some lfs server implementations, they require the ref attribute. #32838
// `ref` is an "optional object describing the server ref that the objects belong to"
- // but some (incorrect) lfs servers require it, so maybe adding an empty ref here doesn't break the correct ones.
+ // but some (incorrect) lfs servers like aliyun require it, so maybe adding an empty ref here doesn't break the correct ones.
// https://github.com/git-lfs/git-lfs/blob/a32a02b44bf8a511aa14f047627c49e1a7fd5021/docs/api/batch.md?plain=1#L37
- request := &BatchRequest{operation, c.transferNames(), &Reference{}, objects}
+ //
+ // UPDATE: it can't use "empty ref" here because it breaks others like https://github.com/go-gitea/gitea/issues/33453
+ request := &BatchRequest{operation, c.transferNames(), nil, objects}
+
payload := new(bytes.Buffer)
err := json.NewEncoder(payload).Encode(request)
if err != nil {