Skip to content

Commit 7616aeb

Browse files
hiifongwxiaoguang
andauthored
In some lfs server implementations, they require the ref attribute. (#32838)
Fix: #32611 In some lfs server implementations, they require the ref attribute. --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 3205915 commit 7616aeb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/lfs/http_client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ func (c *HTTPClient) batch(ctx context.Context, operation string, objects []Poin
7272

7373
url := fmt.Sprintf("%s/objects/batch", c.endpoint)
7474

75-
request := &BatchRequest{operation, c.transferNames(), nil, objects}
75+
// `ref` is an "optional object describing the server ref that the objects belong to"
76+
// but some (incorrect) lfs servers require it, so maybe adding an empty ref here doesn't break the correct ones.
77+
// https://github.com/git-lfs/git-lfs/blob/a32a02b44bf8a511aa14f047627c49e1a7fd5021/docs/api/batch.md?plain=1#L37
78+
request := &BatchRequest{operation, c.transferNames(), &Reference{}, objects}
7679
payload := new(bytes.Buffer)
7780
err := json.NewEncoder(payload).Encode(request)
7881
if err != nil {

0 commit comments

Comments
 (0)