lfs: ensure storeid.size is an integer

Summary:
The request JSON data used in the batch API should have `size` field as an
integer, not a string. This was discovered when testing against GitHub's
`lfs-test-server` implementation [1]. The latter was written in Golang and has
strong type requirement, it will treat `{"size": "42"}` as `{"size": 0}`.

[1]: https://github.com/git-lfs/lfs-test-server

Test Plan:
An integration test with `lfs-test-server` will be added once remaining issues
are resolved.

Reviewers: #mercurial, ikostia, davidsp

Reviewed By: ikostia, davidsp

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5009248

Signature: t1:5009248:1493977299:5daf8d32cd8c933be71a41afcc7ff832eb7edb5a
This commit is contained in:
Jun Wu 2017-05-08 11:11:47 -07:00
parent fd5d8b9996
commit 3f004c2689

View File

@ -17,7 +17,7 @@ from . import (
class StoreID(object):
def __init__(self, oid, size):
self.oid = oid
self.size = size
self.size = int(size)
class local(object):
"""Local blobstore for large file contents.