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