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)
| 92 | /// non-switch commands return `None`. Only commands whose first shell word is |
| 93 | /// `git` are considered. |
| 94 | pub 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 | |
| 99 | fn cursor_branch_switch_target_from_tokens(raw: &[String]) -> Option<String> { |
| 100 | let sub_pos = git_subcommand_pos(raw)?; |
nothing calls this directly
no test coverage detected