Proactively tracks a linked worktree's branch. Returns the [`crate::branch::BranchAddOutcome`] name for logging, or `None` on error.
(wt_root: PathBuf, branch: String)
| 695 | /// Proactively tracks a linked worktree's branch. Returns the |
| 696 | /// [`crate::branch::BranchAddOutcome`] name for logging, or `None` on error. |
| 697 | async fn track_worktree_branch(wt_root: PathBuf, branch: String) -> Option<String> { |
| 698 | match TraceDecay::add_branch_tracking_with_options( |
| 699 | &wt_root, |
| 700 | &branch, |
| 701 | TraceDecayOpenOptions::default(), |
| 702 | ) |
| 703 | .await |
| 704 | { |
| 705 | Ok(outcome) => Some(format!("{outcome:?}")), |
| 706 | Err(_) => None, |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | /// Resolves a `worktrees/<name>` leaf to `(worktree_root, branch)` by reading |
| 711 | /// its `gitdir` file and the linked HEAD. |