Read-support refs-v1; explain fetches a git-refs checkpoint on clone · Entire

Read-support refs-v1; explain fetches a git-refs checkpoint on clone

2e99244·

Soph·2w ago·15 files·+63 added/-35 removed

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

Sessions

291fe479c0a8View transcript

Changes

15

77 unmodified lines  
78  
79  
80  
81  
82  
83  
84  
9 unmodified lines  
94  
95  
96  
97  
97  
98  
99  
100

77 unmodified lines

t.Fatal(err)  
}  
if _, err := checkpointpolicy.WriteLocal(context.Background(), repo, plumbing.ZeroHash, checkpointpolicy.Policy{  
    CheckpointVersion:    "refs-v1",  
    CheckpointVersion:    "refs-v2",  
    CheckpointMinVersion: "branch-v1",  
}); err != nil {  
    t.Fatal(err)  
9 unmodified lines  
if err == nil {  
    t.Fatal("expected unsupported checkpoint policy error")  
}  
if !strings.Contains(err.Error(), `checkpoint_version "refs-v1"`) {  
if !strings.Contains(err.Error(), `checkpoint_version "refs-v2"`) {  
    t.Fatalf("error = %v, want checkpoint policy version", err)  
}  
if _, refErr := repo.Reference(plumbing.NewBranchReferenceName(paths.MetadataBranchName), true); refErr == nil {  

Mcmd/entire/cli/attach_test.go+2/-2

15 unmodified lines

16
17
18
19
19
20
21
22
23
23
24
25
26

15 unmodified lines

_, err := readCheckpointInfoFromStore(context.Background(), checkpointInfoPolicyStub{  
    summary: &checkpoint.CheckpointSummary{  
        CheckpointID:      cpID,  
        CheckpointVersion: "refs-v1",  
        CheckpointVersion: "refs-v2",  
    },  
}, cpID)

require.EqualError(t, err, `checkpoint 111111111111 uses unsupported checkpoint_version "refs-v1": not read-supported by this Entire CLI`)
require.EqualError(t, err, `checkpoint 111111111111 uses unsupported checkpoint_version "refs-v2": not read-supported by this Entire CLI`)
}

type checkpointInfoPolicyStub struct {

Mcmd/entire/cli/checkpoint_policy_read_test.go+2/-2

33 unmodified lines

34
35
36
37
37
38
39
40
9 unmodified lines

50
51
52
53
54
53
54
55
56
57

33 unmodified lines

wantErr string  
}{  
    {name: "checkpoint version", args: []string{"--checkpoint-version", "branch-v2342"}, wantErr: `checkpoint_version "branch-v2342" is not supported by this Entire CLI`},  
    {name: "minimum version", args: []string{"--checkpoint-min-version", "refs-v1"}, wantErr: `checkpoint_min_version "refs-v1" is not supported by this Entire CLI`},  
    {name: "minimum version", args: []string{"--checkpoint-min-version", "refs-v2"}, wantErr: `checkpoint_min_version "refs-v2" is not supported by this Entire CLI`},
}

for _, tt := range tests {
9 unmodified lines

func TestCheckpointPolicyCmd_RejectsDowngradeWithoutForce(t *testing.T) {
    dir, bareDir := setupCheckpointPolicyRepo(t)
    seedCheckpointPolicyForCommand(t, dir, checkpointpolicy.Policy{  
        CheckpointVersion:    "refs-v1",  
        CheckpointMinVersion: "refs-v1",  
        CheckpointVersion:    "refs-v2",  
        CheckpointMinVersion: "refs-v2",  
    })
    pushCheckpointPolicyRefForCommandTest(t, dir, bareDir)

... (truncated for brevity)