# fix: support shared-store session adoption

```go
 db9ada8→main ·
```

## Sessions

48521e055655 View transcript

## Changes

4
- cmd/entire/cli

- checkpoint

- Mopen.go +3/-5

- Msession_adopt.go +66/-5

- Msession_adopt_test.go +132/-19

- strategy

- Mmanual_commit.go +2/-6

```go
 23 unmodified lines

...
}
```

```go
// temporary capability and resolved committed-ref topology.
type Stores struct {
    // Primary is the committed store that serves committed reads and writes.
    Primary CommittedStore
    Primary *GitStore

temporary TemporaryStore
    temporary *GitStore
    refs      CommittedRefs
}

// Temporary returns the git-backed temporary shadow-branch store.
//
//nolint:ireturn // temporary store capability is the abstraction boundary
func (s *Stores) Temporary() TemporaryStore { return s.temporary }
func (s *Stores) Temporary() *GitStore { return s.temporary }

// Refs returns the resolved committed-ref topology.
func (s *Stores) Refs() CommittedRefs { return s.refs }
```

```go
// main function logic and handler functions...
```

func TestSessionAdopt_FiltersSharedSourceStoreByFromWorktree(t *testing.T) {
    // Test logic...
}

func TestStateStoreForWorktreeIgnoresGitStderrOnSuccess(t *testing.T) {
    // Test logic...
}

func TestSessionAdopt_RejectsSameGitCommonDir(t *testing.T) {
    // Test logic...
}

func TestSessionAdopt_MovesSameStoreSessionIntoCurrentWorktree(t *testing.T) {
    // Test logic...
}

```go
func (s *ManualCommitStrategy) getCheckpointStore(ctx context.Context, repo *git.Repository) (*checkpoint.GitStore, error) {
    // implementation logic...
}
```
