fix: FS.write_path starts from the empty tree over an unborn ref#9
Open
ivarvong wants to merge 1 commit into
Open
fix: FS.write_path starts from the empty tree over an unborn ref#9ivarvong wants to merge 1 commit into
ivarvong wants to merge 1 commit into
Conversation
Workspace.commit/2 already treats an unborn ref as parentless, but
Workspace.write/3 failed {:error, :not_found} on the same base — so a
workspace over a freshly initialized or cloned-empty repository could
never stage its first file. Unborn detection is deliberately narrow: a
ref NAME absent from the ref store. A raw SHA that fails to resolve
stays an error, since in a lazy clone that is a fetch miss and an empty
base there would silently drop every existing tree entry.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FpxHS5iGm9ktgpnL9QZu9x
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.
Bootstrapping a repo through a workspace —
Exgit.clonean empty remote (orExgit.init),Workspace.open,write,commit,push— failed at the firstwritewith{:error, :not_found}:FS.write_path/5required the base ref to resolve, whileWorkspace.commit/2already treats an unborn ref as parentless.write_pathnow starts from the empty tree when the base is an unborn ref, so the full lifecycle works against a just-created remote:Unborn detection is deliberately narrow — a ref name with no ref-store entry, per the same name/SHA heuristic
resolve_tree/2uses. A raw SHA that fails to resolve stays{:error, :not_found}: in a lazy clone that is a missing object, and treating it as empty would silently produce a tree that drops every existing entry.🤖 Generated with Claude Code
https://claude.ai/code/session_01FpxHS5iGm9ktgpnL9QZu9x