MCPcopy Create free account
hub / github.com/docker/docker-agent / ForkSession

Function ForkSession

pkg/session/branch.go:31–33  ·  view source on GitHub ↗

ForkSession is like BranchSession but uses fork-numbered titles (" (fork 1)", "(fork 2)", …). It is intended for HTTP/API clients that expose a "fork from here" UX distinct from the TUI's branch-from-edit flow, which keeps using BranchSession.

(parent *Session, branchAtPosition int)

Source from the content-addressed store, hash-verified

29// that expose a "fork from here" UX distinct from the TUI's branch-from-edit
30// flow, which keeps using BranchSession.
31func ForkSession(parent *Session, branchAtPosition int) (*Session, error) {
32 return branchSessionWithTitle(parent, branchAtPosition, generateForkTitle)
33}
34
35func branchSessionWithTitle(parent *Session, branchAtPosition int, titleFn func(string) string) (*Session, error) {
36 if parent == nil {

Callers 2

ForkSessionMethod · 0.92
TestForkSessionFunction · 0.85

Calls 1

branchSessionWithTitleFunction · 0.85

Tested by 1

TestForkSessionFunction · 0.68