test: make tip-read regression test exercise a real fetch · Entire

test: make tip-read regression test exercise a real fetch

83f3f09→main·

Soph·1mo ago·1 file·+6 added/-1 removed

PR review (Copilot): the plain git clone <bareDir> fetched all branches via the local hardlink optimization, so refs/remotes/origin/entire/checkpoints/v1 and its history were already present before FetchMetadataTreeOnly ran — weakening the assertions. Clone single-branch main via file:// so the metadata branch is absent until the tip-read fetches it; the old --depth=1 behavior now visibly shallows the repo and trips the assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

7deb7f80719fView transcript

?\ so in ../entiredb "filtered_fetches" is enabled, now today one of my coworkers had this issue:Claude Code·2 steps

Changes

1

50 unmodified lines

51
52
53
54
55
56
57
58
59
55
60
61
62
63

50 unmodified lines

originTip := gitOutput(t, bareDir, "rev-parse", "refs/heads/"+paths.MetadataBranchName)

// Single-branch file:// clone: fetch only main, via a real fetch-pack rather
    // than the local hardlink optimization. This leaves the metadata branch and
    // its history absent until FetchMetadataTreeOnly fetches them, so the
    // assertions actually exercise the tip-read (the old --depth=1 behavior
    // would shallow the repo here).
    clonedDir := filepath.Join(tmpDir, "cloned")
    runGit(t, tmpDir, "clone", bareDir, clonedDir)
    runGit(t, tmpDir, "clone", "--single-branch", "--branch", "main", "file://"+bareDir, clonedDir)
    runGit(t, clonedDir, "config", "user.email", "test@example.com")
    runGit(t, clonedDir, "config", "user.name", "Test")

Mcmd/entire/cli/treeless_fetch_full_depth_test.go+6/-1