Drop redundant temporary field from checkpoint Stores · Entire
Drop redundant temporary field from checkpoint Stores
e05c2d2→main·
pfleidi·1mo ago·1 file·+7 added/-7 removed
Stores.temporary was always assigned the same *GitStore pointer as Primary, so it was derivable state with no purpose. Temporary() now returns Primary directly, keeping the shadow-branch intent at call sites without a duplicate field.
Sessions
6270a68f519cView transcript
Changes
1
cmd/entire/cli/checkpoint
Mopen.go+7/-7
26 unmodified lines
27
28
29
30
31
30
31
32
33
7 unmodified lines
41
42
43
45
46
47
44
45
46
47
48
4 unmodified lines
53
54
55
58
59
56
57
58
59
60
61
62
26 unmodified lines
// committed reads and writes.
Primary *GitStore
temporary *GitStore
refs CommittedRefs
refs CommittedRefs
// Open resolves the checkpoint storage topology and constructs the backing
7 unmodified lines
store.SetBlobFetcher(opts.BlobFetcher)
}
return &Stores{
Primary: store,
temporary: store,
refs: refs,
Primary: store,
refs: refs,
}, nil
}
4 unmodified lines
return ResolveCommittedRefs(ctx)
// Temporary returns the git-backed temporary (shadow-branch) store.
func (s *Stores) Temporary() *GitStore { return s.temporary }
// Temporary returns the git-backed temporary (shadow-branch) store. It is the
// same backing store as Primary; the name marks shadow-branch intent at the
// call site.
func (s *Stores) Temporary() *GitStore { return s.Primary }
// Refs returns the resolved committed-ref topology.
func (s *Stores) Refs() CommittedRefs { return s.refs }
Mcmd/entire/cli/checkpoint/open.go+7/-7