Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(switch): display PR/MR context when checking out (#782)

Maximilian Roos77afa41160b1
diff --git a/src/commands/worktree/switch.rs b/src/commands/worktree/switch.rs
index 9792950e7..df3660c41 100644
--- a/src/commands/worktree/switch.rs
+++ b/src/commands/worktree/switch.rs
@@ -10,9 +10,10 @@ use dunce::canonicalize;
use worktrunk::config::UserConfig;
use worktrunk::git::mr_ref;
use worktrunk::git::pr_ref::{self, fork_remote_url, prefixed_local_branch_name};
-use worktrunk::git::{GitError, RefType, Repository};
+use worktrunk::git::{GitError, RefContext, RefType, Repository};
use worktrunk::styling::{
- hint_message, info_message, progress_message, suggest_command, warning_message,
+ format_with_gutter, hint_message, info_message, progress_message, suggest_command,
+ warning_message,
};
use super::resolve::{compute_clobber_backup, compute_worktree_path, paths_match};
@@ -27,6 +28,29 @@ struct ResolvedTarget {
method: CreationMethod,
}
+/// Format PR/MR context for gutter display after fetching.
+///
+/// Returns two lines for gutter formatting:
+/// ```text
+/// ┃ Fix authentication bug in login flow (#101)
+/// ┃ by @alice · open · https://github.com/owner/repo/pull/101
+/// ```
+fn format_ref_context(ctx: &impl RefContext) -> String {
+ let mut status_parts = vec![format!("by @{}", ctx.author()), ctx.state().to_string()];
+ if ctx.draft() {
+ status_parts.push("draft".to_string());
+ }
+ let status_line = status_parts.join(" · ");
+
+ cformat!(
+ "<bold>{}</> ({}{})\n{status_line} · <bright-black>{}</>",
+ ctx.title(),
+ ctx.ref_type().symbol(),
+ ctx.number(),
+ ctx.url()
+ )
+}
+
/// Resolve a PR reference (`pr:<number>` syntax).
fn resolve_pr_ref(
repo: &Repository,
@@ -56,6 +80,9 @@ fn resolve_pr_ref(
let repo_root = repo.repo_path();
let pr_info = pr_ref::fetch_pr_info(pr_number, repo_root)?;
+ // Display PR context with URL (as gutter under fetch progress)
+ crate::output::print(format_with_gutter(&format_ref_context(&pr_info), None))?;
+
if pr_info.is_cross_repository {
// Fork PR: check if branch already exists and is tracking this PR
let local_branch = pr_ref::local_branch_name(&pr_info);
@@ -198,6 +225,9 @@ fn resolve_mr_ref(
let repo_root = repo.repo_path();
let mr_info = mr_ref::fetch_mr_info(mr_number, repo_root)?;
+ // Display MR context with URL (as gutter under fetch progress)
+ crate::output::print(format_with_gutter(&format_ref_context(&mr_info), None))?;
+
if mr_info.is_cross_project {
// Fork MR: check if branch already exists and is tracking this MR
let local_branch = mr_ref::local_branch_name(&mr_info);
@@ -607,7 +637,7 @@ pub fn execute_switch(
let result = if already_at_worktree {
SwitchResult::AlreadyAt(path)
} else {
- SwitchResult::Existing(path)
+ SwitchResult::Existing { path }
};
Ok((
diff --git a/src/commands/worktree/types.rs b/src/commands/worktree/types.rs
index 1653b707c..be9f7ef72 100644
--- a/src/commands/worktree/types.rs
+++ b/src/commands/worktree/types.rs
@@ -19,7 +19,7 @@ pub enum SwitchResult {
/// Already at the target worktree (no action taken)
AlreadyAt(PathBuf),
/// Switched to existing worktree at the given path
- Existing(PathBuf),
+ Existing { path: PathBuf },
/// Created new worktree at the given path
Created {
path: PathBuf,
@@ -40,7 +40,7 @@ impl SwitchResult {
pub fn path(&self) -> &PathBuf {
match self {
SwitchResult::AlreadyAt(path) => path,
- SwitchResult::Existing(path) => path,
+ SwitchResult::Existing { path, .. } => path,
SwitchResult::Created { path, .. } => path,
}
}
@@ -238,7 +238,7 @@ mod tests {
#[test]
fn test_switch_result_path_existing() {
let path = PathBuf::from("/test/existing");
- let result = SwitchResult::Existing(path.clone());
+ let result = SwitchResult::Existing { path: path.clone() };
assert_eq!(result.path(), &path);
}
diff --git a/src/git/error.rs b/src/git/error.rs
index 17b59f37f..a65c2524b 100644
--- a/src/git/error.rs
+++ b/src/git/error.rs
@@ -74,6 +74,19 @@ impl RefType {
}
}
+/// Common display fields for PR/MR context.
+///
+/// Implemented by both `PrInfo` and `MrInfo` to enable unified formatting.
+pub trait RefContext {
+ fn ref_type(&self) -> RefType;
+ fn number(&self) -> u32;
+ fn title(&self) -> &str;
+ fn author(&self) -> &str;
+ fn state(&self) -> &str;
+ fn draft(&self) -> bool;
+ fn url(&self) -> &str;
+}
+
/// Domain errors for git and worktree operations.
///
/// This enum provides structured error data that can be pattern-matched and tested.
diff --git a/src/git/mod.rs b/src/git/mod.rs
index 6ac82b81d..ca6a2ef79 100644
--- a/src/git/mod.rs
+++ b/src/git/mod.rs
@@ -40,6 +40,7 @@ pub use error::{
// Special-handling error enum (Display produces styled output)
HookErrorWithHint,
// Platform-specific reference type (PR vs MR)
+ RefContext,
RefType,
WorktrunkError,
// Error inspection functions
diff --git a/src/git/mr_ref.rs b/src/git/mr_ref.rs
index 3cfa948d8..8e57f1ab0 100644
--- a/src/git/mr_ref.rs
+++ b/src/git/mr_ref.rs
@@ -32,6 +32,14 @@ use crate::shell_exec::Cmd;
pub struct MrInfo {
/// The MR number (iid in GitLab terms).
pub number: u32,
+ /// The MR title.
+ pub title: String,
+ /// The MR author's username.
+ pub author: String,
+ /// The MR state ("opened", "closed", "merged").
+ pub state: String,
+ /// Whether this is a draft/WIP MR.
+ pub draft: bool,
/// The branch name in the source project.
pub source_branch: String,
/// The source project ID.
@@ -52,9 +60,38 @@ pub struct MrInfo {
pub url: String,
}
+impl super::RefContext for MrInfo {
+ fn ref_type(&self) -> super::RefType {
+ super::RefType::Mr
+ }
+ fn number(&self) -> u32 {
+ self.number
+ }
+ fn title(&self) -> &str {
+ &self.title
+ }
+ fn author(&self) -> &str {
+ &self.author
+ }
+ fn state(&self) -> &str {
+ &self.state
+ }
+ fn draft(&self) -> bool {
+ self.draft
+ }
+ fn url(&self) -> &str {
+ &self.url
+ }
+}
+
/// Raw JSON response from `glab mr view <number> --output json`.
#[derive(Debug, Deserialize)]
struct GlabMrResponse {
+ title: String,
+ author: GlabAuthor,
+ state: String,
+ #[serde(default)]
+ draft: bool,
source_branch: String,
source_project_id: u64,
target_project_id: u64,
@@ -67,6 +104,11 @@ struct GlabMrResponse {
target_project: Option<GlabProject>,
}
+#[derive(Debug, Deserialize)]
+struct GlabAuthor {
+ username: String,
+}
+
#[derive(Debug, Deserialize)]
struct GlabProject {
ssh_url_to_repo: Option<String>,
@@ -168,6 +210,10 @@ pub fn fetch_mr_info(mr_number: u32, repo_root: &std::path::Path) -> anyhow::Res
Ok(MrInfo {
number: mr_number,
+ title: response.title,
+ author: response.author.username,
+ state: response.state,
+ draft: response.draft,
source_branch: response.source_branch,
source_project_id: response.source_project_id,
target_project_id: response.target_project_id,
@@ -291,6 +337,10 @@ mod tests {
fn test_local_branch_name() {
let mr = MrInfo {
number: 101,
+ title: "Fix authentication bug".to_string(),
+ author: "alice".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature-auth".to_string(),
source_project_id: 123,
target_project_id: 123,
@@ -310,6 +360,10 @@ mod tests {
// the local branch name must match the fork's branch for git push to work
let mr = MrInfo {
number: 101,
+ title: "Fix authentication bug".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature-auth".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -327,6 +381,10 @@ mod tests {
fn test_fork_remote_url_with_both_urls() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -353,6 +411,10 @@ mod tests {
fn test_fork_remote_url_ssh_only() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -373,6 +435,10 @@ mod tests {
fn test_fork_remote_url_https_only() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -396,6 +462,10 @@ mod tests {
fn test_fork_remote_url_none() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -416,6 +486,10 @@ mod tests {
fn test_target_remote_url_with_both_urls() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
@@ -442,6 +516,10 @@ mod tests {
fn test_target_remote_url_none() {
let mr = MrInfo {
number: 101,
+ title: "Feature".to_string(),
+ author: "contributor".to_string(),
+ state: "opened".to_string(),
+ draft: false,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
diff --git a/src/git/pr_ref.rs b/src/git/pr_ref.rs
index 60684fbee..5f77bfce0 100644
--- a/src/git/pr_ref.rs
+++ b/src/git/pr_ref.rs
@@ -41,6 +41,14 @@ use crate::shell_exec::Cmd;
pub struct PrInfo {
/// The PR number.
pub number: u32,
+ /// The PR title.
+ pub title: String,
+ /// The PR author's username.
+ pub author: String,
+ /// The PR state ("open", "closed").
+ pub state: String,
+ /// Whether this is a draft PR.
+ pub draft: bool,
/// The branch name in the head repository.
pub head_ref_name: String,
/// The owner of the head repository (fork owner for cross-repo PRs).
@@ -59,14 +67,48 @@ pub struct PrInfo {
pub url: String,
}
+impl super::RefContext for PrInfo {
+ fn ref_type(&self) -> super::RefType {
+ super::RefType::Pr
+ }
+ fn number(&self) -> u32 {
+ self.number
+ }
+ fn title(&self) -> &str {
+ &self.title
+ }
+ fn author(&self) -> &str {
+ &self.author
+ }
+ fn state(&self) -> &str {
+ &self.state
+ }
+ fn draft(&self) -> bool {
+ self.draft
+ }
+ fn url(&self) -> &str {
+ &self.url
+ }
+}
+
/// Raw JSON response from `gh api repos/{owner}/{repo}/pulls/{number}`.
#[derive(Debug, Deserialize)]
struct GhApiPrResponse {
+ title: String,
+ user: GhUser,
+ state: String,
+ #[serde(default)]
+ draft: bool,
head: GhPrRef,
base: GhPrRef,
html_url: String,
}
+#[derive(Debug, Deserialize)]
+struct GhUser {
+ login: String,
+}
+
#[derive(Debug, Deserialize)]
struct GhPrRef {
#[serde(rename = "ref")]
@@ -219,6 +261,10 @@ pub fn fetch_pr_info(pr_number: u32, repo_root: &std::path::Path) -> anyhow::Res
Ok(PrInfo {
number: pr_number,
+ title: response.title,
+ author: response.user.login,
+ state: response.state,
+ draft: response.draft,
head_ref_name: response.head.ref_name,
head_owner: head_repo.owner.login,
head_repo: head_repo.name,
@@ -319,6 +365,10 @@ mod tests {
fn test_local_branch_name_same_repo() {
let pr = PrInfo {
number: 101,
+ title: "Fix authentication bug".to_string(),
+ author: "alice".to_string(),
+ state: "open".to_string(),
+ draft: false,
head_ref_name: "feature-auth".to_string(),
head_owner: "owner".to_string(),
head_repo: "repo".to_string(),
@@ -337,6 +387,10 @@ mod tests {
// the local branch name must match the fork's branch for git push to work
let pr = PrInfo {
number: 101,
+ title: "Fix authentication bug".to_string(),
+ author: "contributor".to_string(),
+ state: "open".to_string(),
+ draft: false,
head_ref_name: "feature-auth".to_string(),
head_owner: "contributor".to_string(),
head_repo: "repo".to_string(),
@@ -363,6 +417,10 @@ mod tests {
is_cross_repository: true,
host: "github.com".to_string(),
url: "https://github.com/owner/repo/pull/101".to_string(),
+ title: "Test PR".to_string(),
+ author: "contributor".to_string(),
+ state: "open".to_string(),
+ draft: false,
};
assert_eq!(prefixed_local_branch_name(&pr), "contributor/main");
}
diff --git a/src/main.rs b/src/main.rs
index f05f0b4b8..7c6f5d571 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -797,7 +797,7 @@ fn main() {
base_worktree_path,
..
} => (base_branch.as_deref(), base_worktree_path.as_deref()),
- SwitchResult::Existing(_) | SwitchResult::AlreadyAt(_) => (None, None),
+ SwitchResult::Existing { .. } | SwitchResult::AlreadyAt(_) => (None, None),
};
let extra_vars: Vec<(&str, &str)> = [
base_branch.map(|b| ("base", b)),
diff --git a/src/output/handlers.rs b/src/output/handlers.rs
index 49f53bfbe..27e17626b 100644
--- a/src/output/handlers.rs
+++ b/src/output/handlers.rs
@@ -338,7 +338,7 @@ pub fn handle_switch_output(
// User is already there - no path annotation needed
None
}
- SwitchResult::Existing(_) => {
+ SwitchResult::Existing { .. } => {
if let Some(reason) = &shell_warning_reason {
// Shell integration not active — single warning with context
if let Some(warning) = branch_worktree_mismatch_warning {
diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rs
index 940cf935a..ab1310ec0 100644
--- a/tests/integration_tests/switch.rs
+++ b/tests/integration_tests/switch.rs
@@ -1463,6 +1463,10 @@ fn test_switch_pr_same_repo(#[from(repo_with_remote)] mut repo: TestRepo) {
// gh api repos/{owner}/{repo}/pulls/{number} format
let gh_response = r#"{
+ "title": "Fix authentication bug in login flow",
+ "user": {"login": "alice"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-auth",
"repo": {"name": "test-repo", "owner": {"login": "owner"}}
@@ -1504,6 +1508,10 @@ fn test_switch_pr_same_repo_no_remote(#[from(repo_with_remote)] repo: TestRepo)
// but origin points to contributor/test-repo (different repo)
// So find_remote_for_repo("owner", "test-repo") will fail
let gh_response = r#"{
+ "title": "Fix authentication bug in login flow",
+ "user": {"login": "alice"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-auth",
"repo": {"name": "test-repo", "owner": {"login": "owner"}}
@@ -1585,6 +1593,10 @@ fn test_switch_pr_fork(#[from(repo_with_remote)] repo: TestRepo) {
// gh api repos/{owner}/{repo}/pulls/{number} format
// head.repo is the fork (contributor/test-repo), base.repo is the upstream (owner/test-repo)
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -1627,6 +1639,10 @@ fn test_switch_pr_fork_no_upstream_remote(#[from(repo_with_remote)] repo: TestRe
// but origin points to contributor/test-repo (the fork)
// So find_remote_for_repo("owner", "test-repo") will fail
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -1681,6 +1697,10 @@ fn test_switch_pr_deleted_fork(#[from(repo_with_remote)] repo: TestRepo) {
// gh api repos/{owner}/{repo}/pulls/{number} format with null head.repo
// This happens when the fork that the PR was opened from has been deleted
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": null
@@ -1732,6 +1752,10 @@ fn test_switch_pr_fork_existing_same_pr(#[from(repo_with_remote)] repo: TestRepo
// gh api repos/{owner}/{repo}/pulls/{number} format
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -1812,6 +1836,10 @@ fn test_switch_pr_fork_existing_different_pr(#[from(repo_with_remote)] repo: Tes
// gh api repos/{owner}/{repo}/pulls/{number} format
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -1883,6 +1911,10 @@ fn test_switch_pr_fork_existing_no_tracking(#[from(repo_with_remote)] repo: Test
// gh api repos/{owner}/{repo}/pulls/{number} format
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -1963,6 +1995,10 @@ fn test_switch_pr_fork_prefixed_exists_same_pr(#[from(repo_with_remote)] repo: T
]);
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -2028,6 +2064,10 @@ fn test_switch_pr_fork_prefixed_exists_different_pr(#[from(repo_with_remote)] re
]);
let gh_response = r#"{
+ "title": "Add feature fix for edge case",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "feature-fix",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -2191,6 +2231,10 @@ fn test_switch_pr_empty_branch(#[from(repo_with_remote)] repo: TestRepo) {
// Configure gh to return valid JSON but with empty branch name (head.ref is "")
let gh_response = r#"{
+ "title": "PR with empty branch",
+ "user": {"login": "contributor"},
+ "state": "open",
+ "draft": false,
"head": {
"ref": "",
"repo": {"name": "test-repo", "owner": {"login": "contributor"}}
@@ -2298,6 +2342,10 @@ fn test_switch_mr_same_repo(#[from(repo_with_remote)] mut repo: TestRepo) {
// glab mr view <number> --output json format
let glab_response = r#"{
+ "title": "Fix authentication bug in login flow",
+ "author": {"username": "alice"},
+ "state": "opened",
+ "draft": false,
"source_branch": "feature-auth",
"source_project_id": 123,
"target_project_id": 123,
@@ -2406,6 +2454,10 @@ fn test_switch_mr_empty_branch(#[from(repo_with_remote)] repo: TestRepo) {
// Configure glab to return valid JSON but with empty branch name
let glab_response = r#"{
+ "title": "MR with empty branch",
+ "author": {"username": "contributor"},
+ "state": "opened",
+ "draft": false,
"source_branch": "",
"source_project_id": 456,
"target_project_id": 123,
@@ -2490,6 +2542,10 @@ fn test_switch_mr_fork(#[from(repo_with_remote)] repo: TestRepo) {
// glab mr view <number> --output json format
// source_project is the fork (contributor/test-repo), target_project is the upstream (owner/test-repo)
let glab_response = r#"{
+ "title": "Add feature fix for edge case",
+ "author": {"username": "contributor"},
+ "state": "opened",
+ "draft": false,
"source_branch": "feature-fix",
"source_project_id": 456,
"target_project_id": 123,
@@ -2576,6 +2632,10 @@ fn test_switch_mr_fork_existing_branch_tracks_mr(#[from(repo_with_remote)] repo:
// Fork MR response
let glab_response = r#"{
+ "title": "Add feature fix for edge case",
+ "author": {"username": "contributor"},
+ "state": "opened",
+ "draft": false,
"source_branch": "feature-fix",
"source_project_id": 456,
"target_project_id": 123,
@@ -2630,6 +2690,10 @@ fn test_switch_mr_fork_existing_branch_tracks_different(#[from(repo_with_remote)
// Fork MR response for MR 42, but branch tracks MR 99
let glab_response = r#"{
+ "title": "Add feature fix for edge case",
+ "author": {"username": "contributor"},
+ "state": "opened",
+ "draft": false,
"source_branch": "feature-fix",
"source_project_id": 456,
"target_project_id": 123,
@@ -2671,6 +2735,10 @@ fn test_switch_mr_fork_existing_no_tracking(#[from(repo_with_remote)] repo: Test
// Fork MR response
let glab_response = r#"{
+ "title": "Add feature fix for edge case",
+ "author": {"username": "contributor"},
+ "state": "opened",
+ "draft": false,
"source_branch": "feature-fix",
"source_project_id": 456,
"target_project_id": 123,
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork.snap b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork.snap
index 210897bf4..12354bc19 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching MR !42...
+  Add feature fix for edge case (!42)
+  by @contributor · opened · https://gitlab.com/owner/test-repo/-/merge_requests/42
○ Push configured to fork: https://gitlab.com/contributor/test-repo.git
✓ Created branch feature-fix (tracking MR !42) and worktree @ _REPO_.feature-fix
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_different.snap b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_different.snap
index 307e04933..ff7799e69 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_different.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_different.snap
@@ -36,5 +36,7 @@ exit_code: 1
----- stderr -----
◎ Fetching MR !42...
+  Add feature fix for edge case (!42)
+  by @contributor · opened · https://gitlab.com/owner/test-repo/-/merge_requests/42
✗ Branch feature-fix exists but doesn't track MR !42
↳ To free the name, run git branch -m -- feature-fix feature-fix-old
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_mr.snap b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_mr.snap
index cfbf30dea..5c1573e4d 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_mr.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_branch_tracks_mr.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching MR !42...
+  Add feature fix for edge case (!42)
+  by @contributor · opened · https://gitlab.com/owner/test-repo/-/merge_requests/42
○ Branch feature-fix already configured for MR !42
✓ Created worktree for feature-fix @ _REPO_.feature-fix
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_no_tracking.snap b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_no_tracking.snap
index 307e04933..ff7799e69 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_no_tracking.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_mr_fork_existing_no_tracking.snap
@@ -36,5 +36,7 @@ exit_code: 1
----- stderr -----
◎ Fetching MR !42...
+  Add feature fix for edge case (!42)
+  by @contributor · opened · https://gitlab.com/owner/test-repo/-/merge_requests/42
✗ Branch feature-fix exists but doesn't track MR !42
↳ To free the name, run git branch -m -- feature-fix feature-fix-old
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_mr_same_repo.snap b/tests/snapshots/integration__integration_tests__switch__switch_mr_same_repo.snap
index df27961fa..ceb53e4a3 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_mr_same_repo.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_mr_same_repo.snap
@@ -36,5 +36,7 @@ exit_code: 0
----- stderr -----
◎ Fetching MR !101...
+  Fix authentication bug in login flow (!101)
+  by @alice · opened · https://gitlab.com/owner/test-repo/-/merge_requests/101
▲ Worktree for feature-auth @ _REPO_.feature-auth, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork.snap
index c75fb10a4..30a112bc1 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
○ Push configured to fork: https://github.com/contributor/test-repo.git
✓ Created branch feature-fix (tracking PR #42) and worktree @ _REPO_.feature-fix
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_different_pr.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_different_pr.snap
index 55d435831..798ded677 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_different_pr.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_different_pr.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
▲ Using prefixed branch name contributor/feature-fix due to name conflict
↳ Push to fork is not supported with prefixed branches; feedback welcome at https://github.com/max-sixty/worktrunk/issues/714
✓ Created branch contributor/feature-fix (tracking PR #42) and worktree @ _REPO_.contributor-feature-fix
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_no_tracking.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_no_tracking.snap
index 55d435831..798ded677 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_no_tracking.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_no_tracking.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
▲ Using prefixed branch name contributor/feature-fix due to name conflict
↳ Push to fork is not supported with prefixed branches; feedback welcome at https://github.com/max-sixty/worktrunk/issues/714
✓ Created branch contributor/feature-fix (tracking PR #42) and worktree @ _REPO_.contributor-feature-fix
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_same_pr.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_same_pr.snap
index f2065a48d..bd7588022 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_same_pr.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_existing_same_pr.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
○ Branch feature-fix already configured for PR #42
✓ Created worktree for feature-fix @ _REPO_.feature-fix
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_no_upstream.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_no_upstream.snap
index e463cf2b8..df718c37d 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_no_upstream.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_no_upstream.snap
@@ -36,5 +36,7 @@ exit_code: 1
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
✗ No remote found for owner/test-repo
↳ Add the remote: git remote add upstream https://github.com/owner/test-repo.git
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_different_pr.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_different_pr.snap
index e7f47701b..889c12ebf 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_different_pr.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_different_pr.snap
@@ -36,5 +36,7 @@ exit_code: 1
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
✗ Branch contributor/feature-fix exists but doesn't track PR #42
↳ To free the name, run git branch -m -- contributor/feature-fix contributor/feature-fix-old
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_same_pr.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_same_pr.snap
index 18236f548..21dfb4528 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_same_pr.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_fork_prefixed_exists_same_pr.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #42...
+  Add feature fix for edge case (#42)
+  by @contributor · open · https://github.com/owner/test-repo/pull/42
○ Branch contributor/feature-fix already configured for PR #42
▲ Worktree for contributor/feature-fix @ _REPO_.contributor-feature-fix, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo.snap
index 546b17007..f8af0bdf4 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo.snap
@@ -36,6 +36,8 @@ exit_code: 0
----- stderr -----
◎ Fetching PR #101...
+  Fix authentication bug in login flow (#101)
+  by @alice · open · https://github.com/owner/test-repo/pull/101
◎ Fetching feature-auth from origin...
▲ Worktree for feature-auth @ _REPO_.feature-auth, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo_no_remote.snap b/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo_no_remote.snap
index 5779a4b40..63ec38371 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo_no_remote.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_pr_same_repo_no_remote.snap
@@ -36,5 +36,7 @@ exit_code: 1
----- stderr -----
◎ Fetching PR #101...
+  Fix authentication bug in login flow (#101)
+  by @alice · open · https://github.com/owner/test-repo/pull/101
✗ No remote found for owner/test-repo
↳ Add the remote: git remote add upstream https://github.com/owner/test-repo.git