fix(git): handle submodule gitlinks and directory symlinks in working-copy snapshots#1659
Open
bitbloxhub wants to merge 1 commit intoarxanas:masterfrom
Open
Conversation
…-copy snapshots Cherry-picked from my fork's megamerge branch. Fix panics in working-copy snapshot/amend paths when changed entries are not regular files. Previously, snapshot/amend attempted to create blobs by reading paths from disk unconditionally. That fails for: - submodule gitlinks (mode 160000), where path is a directory in superproject - directory symlinks like `ln -s dir/ link`, where symlink handling must use link target bytes, not file read semantics Changes: - add mode-aware object creation for working-copy paths - regular blobs: read file bytes - symlinks: read symlink target and store as blob content - gitlinks/submodules: use index OID instead of reading filesystem path - unreadable/tree: skip as absent - wire mode-aware logic into: - snapshot unstaged commit creation - amend_fast working-copy path processing - add regressions: - dirty submodule no longer crashes status/snapshot flow - trailing-slash directory symlink no longer crashes snapshot flow - amend with dirty submodule no longer crashes - make tests use per-repo submodule source paths to avoid cross-test collisions Fixes arxanas#517 Fixes arxanas#645 Co-authored-by: pi with GPT-5.3-Codex <pi-gpt-5.3-codex@codex.local>
b6409e8 to
7a0651a
Compare
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.
Cherry-picked from my fork's megamerge branch.
Fix panics in working-copy snapshot/amend paths when changed entries are not regular files.
Previously, snapshot/amend attempted to create blobs by reading paths from disk unconditionally. That fails for:
ln -s dir/ link, where symlink handling must use link target bytes, not file read semanticsChanges:
Fixes #517
Fixes #645