Trigger checkout fails across filesystems: git clone --local → EXDEV #57
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implementation: #58
Problem
Forgejo trigger
1104699d-7f89-4cd6-83c4-72116bf5da2f(apull_request_commenton PR #56, 2026-10-22T14:01Z) failed before any session started. The webhook delivery was verified and accepted (HTTP 202). The checkout step failed:createCheckoutinapps/server/src/forgejo/checkout.ts(line ~71) runsgit clone --local --no-checkout <workspacePath> <dest>. The checkout root (<dataDir>/checkouts, here/data/.config/omp-deck/checkouts) is on a different filesystem than the workspace (/workspace/omp-deck), so hardlinking objects fails with EXDEV.git's
builtin/clone.c(copy_or_link_directory) trieslink()first. If that fails it copies the file instead, unless--localwas passed explicitly (option_local > 0), in which case it callsdie_errno("failed to create link ..."). A local-path clone without--localstill uses the local transport and hardlinks when it can. Dropping the flag fixes the cross-device case and keeps the cheap path when both are on the same filesystem.Plan
Approach
apps/server/src/forgejo/checkout.ts,createCheckout: change the clone argv from["clone", "--local", "--no-checkout", opts.workspacePath, dest]to["clone", "--no-checkout", opts.workspacePath, dest]. Do not add--no-hardlinks, because hardlinks are still preferred when they work. Make no other changes to the function.--localhardlinks objects (cheap, no network)" with: "Cloning from the local path hardlinks objects when the checkout root shares the workspace's filesystem and copies them otherwise (no network either way); an explicit--localwould make a cross-device link fatal instead of falling back." Keep the following clause about never using--shared/--referenceunchanged.apps/server/src/forgejo/checkout.test.tscovers same-filesystem behavior and must keep passing.Verification
/workspace/omp-deck:bun test apps/server/src/forgejo/checkout.test.tspasses.deck_forgejo_trigger_listforlucas/omp-deck#56) reaches a started session (non-nullsessionId, no "could not prepare a checkout" reason), and/data/.config/omp-deck/checkouts/lucas/omp-deck/pr-56exists with HEAD at the PR head.