MCPcopy Index your code
hub / github.com/docker/docker-agent / BranchSession

Function BranchSession

pkg/session/branch.go:23–25  ·  view source on GitHub ↗

BranchSession creates a new session branched from the parent at the given position. Messages up to (but not including) branchAtPosition are deep-cloned into the new session.

(parent *Session, branchAtPosition int)

Source from the content-addressed store, hash-verified

21// BranchSession creates a new session branched from the parent at the given position.
22// Messages up to (but not including) branchAtPosition are deep-cloned into the new session.
23func BranchSession(parent *Session, branchAtPosition int) (*Session, error) {
24 return branchSessionWithTitle(parent, branchAtPosition, generateBranchTitle)
25}
26
27// ForkSession is like BranchSession but uses fork-numbered titles
28// ("<title> (fork 1)", "(fork 2)", …). It is intended for HTTP/API clients

Callers 5

handleBranchFromEditMethod · 0.92
handleForkSessionMethod · 0.92
TestBranchSessionFunction · 0.85

Calls 1

branchSessionWithTitleFunction · 0.85

Tested by 3

TestBranchSessionFunction · 0.68