Repository navigation
K2GO-558 fix(proot): git keeps its objects under --link2symlink - #785
Merged
Merged
Conversation
Git finalizes objects with link(), which link2symlink turns into symlinks that later lose their target. Set core.createObject=rename and transfer.unpackLimit=1 in the rootfs bake, and have the app add them to older rootfs trees before each proot launch.
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.
What changes
/etc/gitconfiggetscore.createObject = renameandtransfer.unpackLimit = 1.PRootEngine.executeInContainer), the app adds the same two settings to the rootfs/etc/gitconfigwhen they are not in effect. Rule inproot/domain/GuestGitConfig(pure JVM, unit-tested). Writer inproot/data/GuestGitConfigWriter(temp file + rename, no-op when present).Why
link(). proot--link2symlinkturns that into symlinks whose target is later removed, so the box clone loses objects ("bad object HEAD") and self-updates fail.rename()is not intercepted.Steps to QA
git initin /tmp and make 5 commits. Objects in.git/objectsare symlinks and.l2s.*files appear./etc/gitconfighas both settings. The same test gives 0 symlinks and 0.l2s.*. The box update check (git fetchin/opt/iiab-android) stays clean andgit fsckpasses.Verifications
.l2s.*; change 0 / 0, real box fetch clean, fsck clean. App restart is a no-op.GuestGitConfigTest7/7; full unit suite and lint pass.Notes