Repository navigation
fix(clone): Git LFS clones succeed or open with the real LFS error - #141
Merged
Merged
Conversation
Clone no longer smudges LFS during git clone, so a download, auth, missing git-lfs, or clone-hook protection failure cannot abort checkout. After clone succeeds, install local LFS hooks and pull objects. If that step fails, open the usable repo and show Git LFS's own error plus a Pull retry hint. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
danielss-dev
marked this pull request as ready for review
October 6, 2026 12:58
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.
Closes DAN-80.
Root cause (confirmed)
A local LFS fixture with
filter.lfs.required=trueand an unreachable LFS URL reproduces Daniels’ toast exactly:git clonedid fetch Git objects. Checkout then ran Git LFS smudge, the download failed, and Git aborted the working tree. Strand treated that as a failed clone, so there was no usable repo.error_summarykept only lines starting witherror:/fatal:, so the toast showed the smudge lines and dropped Git LFS’sError downloading/batch response:explanation.A second documented failure mode (Git LFS 3.5 installing hooks during smudge vs newer Git clone protection) is the same class of bug: smudge during clone can abort checkout. Skip-smudge covers both.
Hypothesis 3 (missing
git-lfs) is also covered: with skip-smudge plus disabledfilter.lfs.*, clone no longer dies as a filter failure; if the tree has LFS files andgit lfs versionfails, the user is told Git LFS is not installed.Not confirmed from here: Azure DevOps auth on Daniels’ private
portal-setup(no access). The failure shape matches LFS smudge abort during clone checkout; creds vs missing object vs LFS URL is what the new error text will distinguish on his machine.Approach
Reuse, don’t redesign Clone/LFS dialogs.
clone_with_optionsstill usesclone_args(branch / depth / single-branch / blob:none / recurse /--/validate_remote_argunchanged).GIT_LFS_SKIP_SMUDGE=1(inherited by recursive submodule clones) and-c filter.lfs.process= -c filter.lfs.smudge= -c filter.lfs.required=falseso a missinggit-lfsbinary cannot abort checkout.complete_clone_lfs: if HEAD has LFS paths,git lfs install --localthengit lfs pull, same progress/cancel handle.CloneOutcome.pathso Strand opens the repo;warningcarries the full Git LFS transcript plus “Git LFS → Download and check out objects”.error_summarykeeps LFS explanation lines, not onlyerror:/fatal:.pre-wrap, max-height) instead of a 5-line clamp.Proof
crates/strand-core/tests/clone_lfs.rsclone_with_optionschecks out real contents (not pointer text), status cleanmissing object/Failed to fetch some objects, plus retry hinterror_summary_keeps_git_lfs_explanation_linesuses a transcript shaped like the portal-setup toastcargo test --locked -p strand-core(235 lib + clone_lfs/clone_scope/clone_recursive/sparse_checkout),cargo clippy -p strand-core -- -D warnings,pnpm --filter ./ui exec tsc --noEmit,pnpm --filter ./ui test(584)Live check still needed on Daniels’ machine
Cannot reach private
portal-setup/ Azure DevOps from CI.portal-setupin Strand on WindowsOnPremiseInstallation/rustfs/rustfs.exeis the real binary, status cleanDo not merge until that live check (or an explicit skip) is done.