Skip to content

fix(desktop): classify long-path checkout failures as actionable repo errors - #6461

Open
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/desktop-classify-path-checkout-errors
Open

fix(desktop): classify long-path checkout failures as actionable repo errors#6461
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/desktop-classify-path-checkout-errors

Conversation

@santhiprakash

Copy link
Copy Markdown

Summary

projectRepoUnavailableReason returns unknown whenever a git failure mentions filename too long or unable to checkout working tree, so the Projects panel falls back to the generic "Repository unavailable" copy and the user has no hint that the cause is a fixable local git setting.

This is the second reported instance of a specific, fixable local-git problem being flattened into the unknown bucket (#5989 notes the Windows MAX_PATH case, sibling of #5348 for the macOS git <2.46 case). The panel needs a reason it can route to actionable copy.

Changes

  • Add a new path reason to ProjectRepoUnavailableReason that matches /filename too long|unable to checkout working tree/.
  • Give path actionable copy ("Paths exceed local limit") pointing the user at core.longpaths and the Windows long-path setting.
  • Register a TriangleAlert icon in ProjectRepositoryUnavailableState.tsx and a "Path too long" status row in ProjectCards.tsx so the card-level indicator stays in sync with the full panel.
  • Cover the new reason with three tests (classification, refinement pass-through, presentation).

The core.longpaths injection itself ships in #6095. That PR resolves the user-visible failure on machines where git's own setting is the lever; this PR ships the classification half so the panel can render meaningful text once the config fix lands — and also for any user whose core.longpaths is unreachable for other reasons (e.g. they did not know to set it, or a future code path produces the same git error string).

Related issue

Fixes the classification half of #5989.

The reporter's option 1 (one-line config injection) is PR #6095. This PR is option 3 from the same report. The two are independent and can land in either order; the panel classification is correct with or without the config injection, and the config injection is correct with or without the classification.

Testing

pnpm typecheck from desktop/ clean.

node --import ./test-loader.mjs --experimental-strip-types --test src/features/projects/lib/projectRepoAvailability.test.mjs: 12 passed, 0 failed (3 new: classification, refinement pass-through, presentation).

pnpm lint: 3 warnings / 2 infos, all pre-existing and unrelated to the touched files.

Manual: projectRepoUnavailableReason returns path for both fixture strings from the issue ("Filename too long" and "fatal: unable to checkout working tree"); refineRepoUnavailableReason leaves path untouched, matching its behavior for other non-missing reasons; projectRepoUnavailablePresentation('path') returns the expected {title, description} pair.

… errors

projectRepoUnavailableReason returned 'unknown' for git failures that
mention 'filename too long' or 'unable to checkout working tree', so the
Projects panel fell back to the generic 'Repository unavailable' copy.
This is the second reported instance of a fixable local-git problem being
flattened into the unknown bucket (block#5989, sibling of block#5348), and the
panel needs a reason it can route to actionable copy.

Add a new 'path' reason that matches the Windows MAX_PATH surface, give
it copy that points the user at git's core.longpaths / Windows long-path
setting, and register a TriangleAlert icon plus the card tooltip status.
The core.longpaths injection itself ships in block#6095; this PR ships the
classification half so the panel can render meaningful text once the
config fix lands (or for any user whose core.longpaths is unreachable for
other reasons).

Fixes block#5989 (classification half)

Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
@santhiprakash
santhiprakash requested a review from a team as a code owner August 21, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant