Prevent git push when LFS objects are missing
Finds new blobs during
git-receive-pack and checks for any LFS pointers. If any of these are not in the
lfs_objects table from a prior
git lfs push then an error is raised to abort the push.
Prevent repos getting to a broken state where they can' be cloned or have changes pulled.
- This involves checking each new blob to see if it is an LFS pointer.
- This uses
git rev-listto find new blobs and checks
- Fetching blob details is currently done with Rugged when we'd preferably use gitaly
- For repositories which don't use LFS we'll want a way of bypassing this slow check
Do we need a way to bypass this if
git lfs push --allfails to work?
- Consider having some kind of limit on this for performance
- Enquire about performance impact of current approach
- Changelog entry added, if necessary
- Documentation created/updated
- API support added
- Tests added for this feature/bug
- Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24564
- Accidentally committed to EE in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2761 which this replaces