fix(land): deepen a shallow clone before comparing against the base

Merged
KH
1mo ago
+28-5

The first production land run (cloud#5806, lr_18053aba) failed in stage A at step run-12: hosted runs clone the land ref shallow, so after fetching the base branch git merge-base <base> HEAD found no common ancestor and the following git diff got an empty revision (fatal: ambiguous argument '').

Fix: unshallow the checkout first when git rev-parse --is-shallow-repository is true.

This exact file is already deployed as the workspace's land flow (version 2) so the end-to-end run can continue; this PR keeps the repo in step. flows check passes.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes two failures in the hosted land flow: shallow clones breaking the base-branch diff, and the timestamp helper failing under dash.

  • The base-branch fetch now deepens the checkout via a shell conditional (--unshallow only when git rev-parse --is-shallow-repository reports a shallow clone), instead of a separate unshallow step. Folding it into the explicit base refspec fetch also means a deleted land ref can't fail a bare git fetch origin before the supersession check.
  • Quoted the node -p expression in the timestamp helper; previously Date.now() was parsed as shell syntax by /bin/sh and aborted the run.
  • Added a test that verifies the unshallow switch against real shallow and full clones, and updated the flow test fake for the new fetch and quoting.

Agent Relay sessions

  • claude session a71ff4c9 · opened via gh pr create · last active 2026-10-30