# HG changeset patch # User Marcin Kuzminski # Date 2017-04-17 22:11:05 # Node ID e75ea5c6ab3bf13fa6da68a7f8320dc75dcfc030 # Parent 58bca94a695a086089b02f59fba1f6e97b62215f git-lfs: always validate uploaded files size. In case of bad uploads we want the client to re-try the LFS object upload. Else we can end up with wrong sized OIDs uploaded and reported as OK. diff --git a/vcsserver/git_lfs/lib.py b/vcsserver/git_lfs/lib.py --- a/vcsserver/git_lfs/lib.py +++ b/vcsserver/git_lfs/lib.py @@ -79,7 +79,12 @@ class OidHandler(object): # verify if we have the OID before, if we do, reply with empty if store.has_oid(): log.debug('LFS: store already has oid %s', store.oid) - if skip_existing: + + # validate size + size_match = store.size_oid() == self.obj_size + if not size_match: + log.warning('LFS: size mismatch for oid:%s', self.oid) + elif skip_existing: log.debug('LFS: skipping further action as oid is existing') return response, has_errors