MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / cursor_branch_switch_target

Function cursor_branch_switch_target

src/hooks/cursor_shell.rs:94–97  ·  view source on GitHub ↗

Returns the target branch for a branch-changing git command: `git checkout `, `git switch `, `git checkout -b `, and `git switch -c `. Worktree creation is classified separately by [`cursor_shell_sync_plan`], which owns `git worktree add` parsing. Path checkouts (`git checkout -- ` or obvious file pathspecs), remote tracking shortcuts such as `git switch --tr

(command: &str)

Source from the content-addressed store, hash-verified

92/// non-switch commands return `None`. Only commands whose first shell word is
93/// `git` are considered.
94pub fn cursor_branch_switch_target(command: &str) -> Option<String> {
95 let raw = shell_words(command);
96 cursor_branch_switch_target_from_tokens(&raw)
97}
98
99fn cursor_branch_switch_target_from_tokens(raw: &[String]) -> Option<String> {
100 let sub_pos = git_subcommand_pos(raw)?;

Callers

nothing calls this directly

Calls 2

shell_wordsFunction · 0.85

Tested by

no test coverage detected