Expand description
Git plumbing for the state branch topology: orphan branch creation,
remote-tracking setup, and worktree attachment for an existing branch.
Separate from git.rs so that module stays under the 300-line cap.
Functionsยง
- branch_
exists - True if
branchexists locally. - create_
orphan_ branch - Create an orphan branch pointing at a single empty-tree commit.
Uses
mktree+commit-tree+update-refso no working tree is disturbed; safe to call from any checkout. - create_
tracking_ branch - Create a local branch tracking
remote/branch. Assumes the remote branch already exists as a remote-tracking ref. - has_
remote_ branch - True if
remote/branchexists as a remote-tracking ref. - log_
subjects - Return the subject line of every commit reachable from
refname, oldest first in output iteration order (git log gives newest first; we reverse for stable order). - worktree_
add_ existing - Check out an existing branch into a new worktree.