Sync LFS objects across repos.#39
Open
vorporeal wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Git sync only transfers commits and LFS pointer files, which can leave the target repo referencing LFS objects that were never uploaded to its LFS store. This mirrors the referenced LFS objects during sync by detecting LFS pointer files, fetching the exact source objects, and pushing only those object IDs to the peer repo before the sync branch is pushed.
The implementation is intentionally conservative: private-to-public mirroring runs against the stripped clean snapshot, filters pointer-shaped files down to paths actually tracked by Git LFS, scans all pointers when
.gitattributeschanges, and logs the paths associated with each mirrored object. LFS payload materialization uses exactgit cat-file --filterspaths with historical attributes, avoids path-list parsing pitfalls, and fails closed if filters return the expected pointer instead of payload bytes.This also enforces that text LFS payloads do not contain repo-sync private markers, wires that validation into the marker-check action, configures Git LFS filters in the sync workflow, and bounds pointer detection reads so large LFS payloads are not loaded into memory just to check for an unsmudged pointer.
Testing
uv run pytest tests/stack/test_lfs.py tests/stack/test_git_ops.py tests/test_lfs_payload_validation.py tests/workflows/test_lfs_mirroring.py tests/workflows/test_sync_workflow_config.pyuv run pytest testsgit --no-pager diff --checkCo-Authored-By: Oz oz-agent@warp.dev