Skip to content

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

refactor: reduce reliance on primary remote for CI and fork URLs (#753)

Maximilian Roos9d4384451542
diff --git a/src/commands/list/ci_status/github.rs b/src/commands/list/ci_status/github.rs
index a9623e41d..ab852fcf3 100644
--- a/src/commands/list/ci_status/github.rs
+++ b/src/commands/list/ci_status/github.rs
@@ -3,28 +3,26 @@
//! Detects CI status from GitHub PRs and workflow runs using the `gh` CLI.
use serde::Deserialize;
-use worktrunk::git::{Repository, parse_owner_repo, parse_remote_owner};
+use worktrunk::git::{GitRemoteUrl, Repository, parse_remote_owner};
use super::{
CiSource, CiStatus, MAX_PRS_TO_FETCH, PrStatus, is_retriable_error, non_interactive_cmd,
parse_json,
};
-/// Get the owner of the origin remote (for GitHub fork detection).
-///
-/// Used for client-side filtering of PRs by source repository.
-/// See [`parse_remote_owner`] for details on why this is necessary.
-fn get_origin_owner(repo: &Repository) -> Option<String> {
- let url = repo.primary_remote_url()?;
- parse_remote_owner(&url)
-}
-
-/// Get the owner and repo name from the primary remote.
+/// Get the owner and repo name from any GitHub remote.
///
/// Used for GitHub API calls that require `repos/{owner}/{repo}/...` paths.
-fn get_owner_repo(repo: &Repository) -> Option<(String, String)> {
- let url = repo.primary_remote_url()?;
- parse_owner_repo(&url)
+/// Searches all remotes for a GitHub URL (API calls are repo-wide, not branch-specific).
+fn get_github_owner_repo(repo: &Repository) -> Option<(String, String)> {
+ for (_, url) in repo.all_remote_urls() {
+ if let Some(parsed) = GitRemoteUrl::parse(&url)
+ && parsed.is_github()
+ {
+ return Some((parsed.owner().to_string(), parsed.repo().to_string()));
+ }
+ }
+ None
}
/// Detect GitHub PR CI status for a branch.
@@ -38,7 +36,7 @@ fn get_owner_repo(repo: &Repository) -> Option<(String, String)> {
/// Since `gh pr list --head` doesn't support `owner:branch` format, we:
/// 1. Fetch all open PRs with matching branch name (up to 20)
/// 2. Include `headRepositoryOwner` in the JSON output
-/// 3. Filter client-side by comparing `headRepositoryOwner.login` to our origin owner
+/// 3. Filter client-side by comparing `headRepositoryOwner.login` to the branch's push remote owner
///
/// This correctly handles:
/// - Fork workflows (PRs from your fork to upstream)
@@ -47,10 +45,18 @@ fn get_owner_repo(repo: &Repository) -> Option<(String, String)> {
pub(super) fn detect_github(repo: &Repository, branch: &str, local_head: &str) -> Option<PrStatus> {
let repo_root = repo.current_worktree().root().ok()?;
- // Get origin owner for filtering (see parse_remote_owner docs for why)
- let origin_owner = get_origin_owner(repo);
- if origin_owner.is_none() {
- log::debug!("Could not determine origin owner for {}", branch);
+ // Get the owner of the branch's push remote for filtering PRs by source repository.
+ // Uses @{push} which resolves through pushRemote → remote.pushDefault → tracking remote.
+ let branch_owner = repo
+ .branch(branch)
+ .github_push_url()
+ .and_then(|url| parse_remote_owner(&url));
+ if branch_owner.is_none() {
+ log::debug!(
+ "Branch {} has no GitHub push remote; skipping PR-based CI detection",
+ branch
+ );
+ return None;
}
// Use `gh pr list --head` instead of `gh pr view` to handle numeric branch names correctly.
@@ -96,32 +102,22 @@ pub(super) fn detect_github(repo: &Repository, branch: &str, local_head: &str) -
// Filter to PRs from our origin (case-insensitive comparison for GitHub usernames).
// If headRepositoryOwner is missing (older GH CLI, Enterprise, or permissions),
// treat it as a potential match to avoid false negatives.
- let pr_info = if let Some(ref owner) = origin_owner {
- let matched = pr_list.iter().find(|pr| {
- pr.head_repository_owner
- .as_ref()
- .map(|h| h.login.eq_ignore_ascii_case(owner))
- .unwrap_or(true) // Missing owner field = potential match
- });
- if matched.is_none() && !pr_list.is_empty() {
- log::debug!(
- "Found {} PRs for branch {} but none from origin owner {}",
- pr_list.len(),
- branch,
- owner
- );
- }
- matched
- } else {
- // If we can't determine origin owner, fall back to first open PR
- // This is less accurate but better than nothing
+ let owner = branch_owner.as_ref().unwrap(); // Safe: returned early if None
+ let pr_info = pr_list.iter().find(|pr| {
+ pr.head_repository_owner
+ .as_ref()
+ .map(|h| h.login.eq_ignore_ascii_case(owner))
+ .unwrap_or(true) // Missing owner field = potential match
+ });
+ if pr_info.is_none() && !pr_list.is_empty() {
log::debug!(
- "No origin owner for {}, using first open PR for branch {}",
- repo_root.display(),
- branch
+ "Found {} PRs for branch {} but none from owner {}",
+ pr_list.len(),
+ branch,
+ owner
);
- pr_list.first()
- }?;
+ }
+ let pr_info = pr_info?;
// Determine CI status using priority: conflicts > running > failed > passed > no_ci
let ci_status = if pr_info.merge_state_status.as_deref() == Some("DIRTY") {
@@ -151,7 +147,7 @@ pub(super) fn detect_github(repo: &Repository, branch: &str, local_head: &str) -
/// status across multiple workflows (e.g., `ci` and `publish-docs`).
pub(super) fn detect_github_commit_checks(repo: &Repository, local_head: &str) -> Option<PrStatus> {
let repo_root = repo.current_worktree().root().ok()?;
- let (owner, repo_name) = get_owner_repo(repo)?;
+ let (owner, repo_name) = get_github_owner_repo(repo)?;
// Use GitHub's check-runs API to get all checks for this commit
let output = match non_interactive_cmd("gh")
diff --git a/src/commands/list/ci_status/platform.rs b/src/commands/list/ci_status/platform.rs
index 6f0f140e1..d8f1e2a90 100644
--- a/src/commands/list/ci_status/platform.rs
+++ b/src/commands/list/ci_status/platform.rs
@@ -3,7 +3,7 @@
//! Determines whether a repository uses GitHub or GitLab based on
//! project config override or remote URL detection.
-use worktrunk::git::Repository;
+use worktrunk::git::{GitRemoteUrl, Repository};
/// CI platform detected from project config override or remote URL.
///
@@ -17,12 +17,14 @@ pub enum CiPlatform {
GitLab,
}
-/// Detect the CI platform from a remote URL by searching for "github" or "gitlab".
+/// Detect the CI platform from a remote URL.
+///
+/// Uses [`GitRemoteUrl`] to parse the URL and check the host for "github" or "gitlab".
pub fn detect_platform_from_url(url: &str) -> Option<CiPlatform> {
- let url_lower = url.to_ascii_lowercase();
- if url_lower.contains("github") {
+ let parsed = GitRemoteUrl::parse(url)?;
+ if parsed.is_github() {
Some(CiPlatform::GitHub)
- } else if url_lower.contains("gitlab") {
+ } else if parsed.is_gitlab() {
Some(CiPlatform::GitLab)
} else {
None
@@ -32,8 +34,8 @@ pub fn detect_platform_from_url(url: &str) -> Option<CiPlatform> {
/// Get the CI platform for a repository.
///
/// If `platform_override` is provided (from project config `[ci] platform`),
-/// uses that value directly. Otherwise, detects platform from the primary
-/// remote URL.
+/// uses that value directly. Otherwise, searches all remote URLs for a
+/// supported platform (GitHub or GitLab).
pub fn get_platform_for_repo(
repo: &Repository,
platform_override: Option<&str>,
@@ -50,9 +52,19 @@ pub fn get_platform_for_repo(
);
}
- // Fall back to URL detection
- let url = repo.primary_remote_url()?;
- detect_platform_from_url(&url)
+ // Search all remotes for a supported platform
+ for (remote_name, url) in repo.all_remote_urls() {
+ if let Some(platform) = detect_platform_from_url(&url) {
+ log::debug!(
+ "Detected CI platform {} from remote '{}'",
+ platform,
+ remote_name
+ );
+ return Some(platform);
+ }
+ }
+
+ None
}
#[cfg(test)]
diff --git a/src/commands/worktree/switch.rs b/src/commands/worktree/switch.rs
index b72c8bf05..4f9310ca8 100644
--- a/src/commands/worktree/switch.rs
+++ b/src/commands/worktree/switch.rs
@@ -96,9 +96,8 @@ fn resolve_switch_target(
}
// Branch doesn't exist - need full fork PR setup
- let remote_url = repo.primary_remote_url().unwrap_or_default();
let fork_push_url =
- fork_remote_url(&pr_info.head_owner, &pr_info.head_repo, &remote_url);
+ fork_remote_url(&pr_info.host, &pr_info.head_owner, &pr_info.head_repo);
return Ok(ResolvedTarget {
branch: local_branch,
@@ -106,6 +105,7 @@ fn resolve_switch_target(
pr_number,
fork_push_url,
pr_url: pr_info.url,
+ host: pr_info.host,
base_owner: pr_info.base_owner,
base_repo: pr_info.base_repo,
},
@@ -118,9 +118,8 @@ fn resolve_switch_target(
let remote = repo
.find_remote_for_repo(&pr_info.base_owner, &pr_info.base_repo)
.ok_or_else(|| {
- // Use PR's URL as reference - it has the correct host (github.com or enterprise)
let suggested_url =
- fork_remote_url(&pr_info.base_owner, &pr_info.base_repo, &pr_info.url);
+ fork_remote_url(&pr_info.host, &pr_info.base_owner, &pr_info.base_repo);
GitError::NoRemoteForRepo {
owner: pr_info.base_owner.clone(),
repo: pr_info.base_repo.clone(),
@@ -202,16 +201,15 @@ fn resolve_switch_target(
}
// Branch doesn't exist - need full fork MR setup
- let remote_url = repo.primary_remote_url().unwrap_or_default();
- let fork_push_url =
- mr_ref::fork_remote_url(&mr_info, &remote_url).ok_or_else(|| {
- anyhow::anyhow!(
- "MR !{} is from a fork but glab didn't provide source project URL; \
+ // Use `glab config get git_protocol` to determine SSH vs HTTPS preference.
+ let fork_push_url = mr_ref::fork_remote_url(&mr_info).ok_or_else(|| {
+ anyhow::anyhow!(
+ "MR !{} is from a fork but glab didn't provide source project URL; \
upgrade glab or checkout the fork branch manually",
- mr_number
- )
- })?;
- let target_project_url = mr_ref::target_remote_url(&mr_info, &remote_url);
+ mr_number
+ )
+ })?;
+ let target_project_url = mr_ref::target_remote_url(&mr_info);
return Ok(ResolvedTarget {
branch: local_branch,
@@ -642,6 +640,7 @@ pub fn execute_switch(
pr_number,
fork_push_url,
pr_url: _,
+ host,
base_owner,
base_repo,
} => {
@@ -651,10 +650,7 @@ pub fn execute_switch(
let remote = repo
.find_remote_for_repo(base_owner, base_repo)
.ok_or_else(|| {
- // Construct suggested URL using primary remote's protocol/host
- let reference_url = repo.primary_remote_url().unwrap_or_default();
- let suggested_url =
- fork_remote_url(base_owner, base_repo, &reference_url);
+ let suggested_url = fork_remote_url(host, base_owner, base_repo);
GitError::NoRemoteForRepo {
owner: base_owner.clone(),
repo: base_repo.clone(),
@@ -706,17 +702,24 @@ pub fn execute_switch(
// Find the remote that points to the target project (where MR refs live).
// This handles contributor clones where origin=fork and upstream=target.
- //
- // TODO: The fallback to primary_remote/origin is silent and can pick the
- // wrong remote (e.g., fork instead of target), causing fetch to fail with
- // a confusing "ref not found" error. Consider erroring with a targeted hint
- // like "add upstream remote for target project" when target_project_url is
- // missing or can't be matched to any remote.
- let remote = target_project_url
- .as_ref()
- .and_then(|url| repo.find_remote_by_url(url))
- .or_else(|| repo.primary_remote().ok())
- .unwrap_or_else(|| "origin".to_string());
+ let remote = match &target_project_url {
+ Some(url) => repo.find_remote_by_url(url).ok_or_else(|| {
+ anyhow::anyhow!(
+ "No remote found for target project; \
+ add a remote pointing to {} (e.g., `git remote add upstream {}`)",
+ url,
+ url
+ )
+ })?,
+ None => {
+ // glab didn't provide target project URL (older version)
+ anyhow::bail!(
+ "MR !{} is from a fork but glab didn't provide target project URL; \
+ upgrade glab or checkout the fork branch manually",
+ mr_number
+ );
+ }
+ };
// Fetch the MR head (progress already shown during planning)
repo.run_command(&["fetch", &remote, &mr_ref])
diff --git a/src/commands/worktree/types.rs b/src/commands/worktree/types.rs
index 4a49eeda5..8a01b9258 100644
--- a/src/commands/worktree/types.rs
+++ b/src/commands/worktree/types.rs
@@ -68,6 +68,8 @@ pub enum CreationMethod {
pr_number: u32,
fork_push_url: String,
pr_url: String,
+ /// GitHub host (e.g., "github.com", "github.enterprise.com")
+ host: String,
/// Owner of the base repository (where the PR was opened)
base_owner: String,
/// Name of the base repository
diff --git a/src/git/mod.rs b/src/git/mod.rs
index 225fb0813..a96c8702d 100644
--- a/src/git/mod.rs
+++ b/src/git/mod.rs
@@ -47,7 +47,7 @@ pub use error::{
};
pub use parse::{parse_porcelain_z, parse_untracked_files};
pub use repository::{Branch, Repository, ResolvedWorktree, WorkingTree, set_base_path};
-pub(crate) use url::GitRemoteUrl;
+pub use url::GitRemoteUrl;
pub use url::{parse_owner_repo, parse_remote_owner};
/// Why branch content is considered integrated into the target branch.
///
diff --git a/src/git/mr_ref.rs b/src/git/mr_ref.rs
index d853a859d..0983e9d32 100644
--- a/src/git/mr_ref.rs
+++ b/src/git/mr_ref.rs
@@ -340,15 +340,30 @@ pub fn local_branch_name(mr: &MrInfo) -> String {
mr.source_branch.clone()
}
-/// Get the fork remote URL for pushing, matching the protocol of the reference URL.
+/// Get the git protocol configured in `glab` (GitLab CLI).
+///
+/// Returns "https" or "ssh" based on `glab config get git_protocol`.
+/// Defaults to "https" if the command fails or returns unexpected output.
+pub fn get_git_protocol() -> String {
+ Cmd::new("glab")
+ .args(["config", "get", "git_protocol"])
+ .run()
+ .ok()
+ .filter(|output| output.status.success())
+ .map(|output| String::from_utf8_lossy(&output.stdout).trim().to_string())
+ .filter(|p| p == "ssh" || p == "https")
+ .unwrap_or_else(|| "https".to_string())
+}
+
+/// Get the fork remote URL for pushing.
///
/// For fork MRs, we need the source project's URL. GitLab provides both SSH and
-/// HTTP URLs; we choose based on the primary remote's protocol.
+/// HTTP URLs; we choose based on `glab config get git_protocol`.
///
-/// Falls back to HTTP URL if SSH is not available, or returns `None` if neither
-/// is available (shouldn't happen for valid MRs).
-pub fn fork_remote_url(mr: &MrInfo, reference_url: &str) -> Option<String> {
- let use_ssh = reference_url.starts_with("git@") || reference_url.contains("ssh://");
+/// Falls back to the other protocol if the preferred one is not available.
+/// Returns `None` if neither URL is available (shouldn't happen for valid MRs).
+pub fn fork_remote_url(mr: &MrInfo) -> Option<String> {
+ let use_ssh = get_git_protocol() == "ssh";
if use_ssh {
mr.source_project_ssh_url
@@ -364,12 +379,11 @@ pub fn fork_remote_url(mr: &MrInfo, reference_url: &str) -> Option<String> {
/// Get the target project URL (where MR refs live).
///
/// For fork MRs, we need to fetch from the target project's MR refs. GitLab
-/// provides both SSH and HTTP URLs; we return whichever is available (preferring
-/// the one matching the reference URL protocol).
+/// provides both SSH and HTTP URLs; we choose based on `glab config get git_protocol`.
///
/// Returns `None` if glab didn't provide target project URLs (older versions).
-pub fn target_remote_url(mr: &MrInfo, reference_url: &str) -> Option<String> {
- let use_ssh = reference_url.starts_with("git@") || reference_url.contains("ssh://");
+pub fn target_remote_url(mr: &MrInfo) -> Option<String> {
+ let use_ssh = get_git_protocol() == "ssh";
if use_ssh {
mr.target_project_ssh_url
@@ -449,7 +463,7 @@ mod tests {
}
#[test]
- fn test_fork_remote_url_ssh() {
+ fn test_fork_remote_url_with_both_urls() {
let mr = MrInfo {
number: 101,
source_branch: "feature".to_string(),
@@ -463,28 +477,54 @@ mod tests {
url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
};
- // SSH reference → SSH fork URL
- let url = fork_remote_url(&mr, "[email protected]:owner/repo.git");
- assert_eq!(url, Some("[email protected]:contributor/repo.git".to_string()));
+ // When both URLs are available, returns one based on glab config
+ let url = fork_remote_url(&mr);
+ assert!(url.is_some());
+ let url = url.unwrap();
+ let valid_urls = [
+ "[email protected]:contributor/repo.git",
+ "https://gitlab.com/contributor/repo.git",
+ ];
+ assert!(valid_urls.contains(&url.as_str()), "unexpected URL: {url}");
}
#[test]
- fn test_fork_remote_url_https() {
+ fn test_fork_remote_url_ssh_only() {
let mr = MrInfo {
number: 101,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
source_project_ssh_url: Some("[email protected]:contributor/repo.git".to_string()),
- source_project_http_url: Some("https://gitlab.com/contributor/repo.git".to_string()),
+ source_project_http_url: None,
target_project_ssh_url: Some("[email protected]:owner/repo.git".to_string()),
+ target_project_http_url: None,
+ is_cross_project: true,
+ url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
+ };
+
+ // When only SSH is available, returns SSH regardless of config
+ let url = fork_remote_url(&mr);
+ assert_eq!(url, Some("[email protected]:contributor/repo.git".to_string()));
+ }
+
+ #[test]
+ fn test_fork_remote_url_https_only() {
+ let mr = MrInfo {
+ number: 101,
+ source_branch: "feature".to_string(),
+ source_project_id: 456,
+ target_project_id: 123,
+ source_project_ssh_url: None,
+ source_project_http_url: Some("https://gitlab.com/contributor/repo.git".to_string()),
+ target_project_ssh_url: None,
target_project_http_url: Some("https://gitlab.com/owner/repo.git".to_string()),
is_cross_project: true,
url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
};
- // HTTPS reference → HTTPS fork URL
- let url = fork_remote_url(&mr, "https://gitlab.com/owner/repo.git");
+ // When only HTTPS is available, returns HTTPS regardless of config
+ let url = fork_remote_url(&mr);
assert_eq!(
url,
Some("https://gitlab.com/contributor/repo.git".to_string())
@@ -492,28 +532,27 @@ mod tests {
}
#[test]
- fn test_fork_remote_url_fallback() {
- // Only SSH URL available
+ fn test_fork_remote_url_none() {
let mr = MrInfo {
number: 101,
source_branch: "feature".to_string(),
source_project_id: 456,
target_project_id: 123,
- source_project_ssh_url: Some("[email protected]:contributor/repo.git".to_string()),
+ source_project_ssh_url: None,
source_project_http_url: None,
- target_project_ssh_url: Some("[email protected]:owner/repo.git".to_string()),
+ target_project_ssh_url: None,
target_project_http_url: None,
is_cross_project: true,
url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
};
- // HTTPS reference but only SSH available → falls back to SSH
- let url = fork_remote_url(&mr, "https://gitlab.com/owner/repo.git");
- assert_eq!(url, Some("[email protected]:contributor/repo.git".to_string()));
+ // When no source URLs are available, returns None
+ let url = fork_remote_url(&mr);
+ assert_eq!(url, None);
}
#[test]
- fn test_target_remote_url_ssh() {
+ fn test_target_remote_url_with_both_urls() {
let mr = MrInfo {
number: 101,
source_branch: "feature".to_string(),
@@ -527,13 +566,19 @@ mod tests {
url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
};
- // SSH reference → SSH target URL
- let url = target_remote_url(&mr, "[email protected]:owner/repo.git");
- assert_eq!(url, Some("[email protected]:owner/repo.git".to_string()));
+ // When both URLs are available, returns one based on glab config
+ let url = target_remote_url(&mr);
+ assert!(url.is_some());
+ let url = url.unwrap();
+ let valid_urls = [
+ "[email protected]:owner/repo.git",
+ "https://gitlab.com/owner/repo.git",
+ ];
+ assert!(valid_urls.contains(&url.as_str()), "unexpected URL: {url}");
}
#[test]
- fn test_target_remote_url_https() {
+ fn test_target_remote_url_none() {
let mr = MrInfo {
number: 101,
source_branch: "feature".to_string(),
@@ -541,14 +586,14 @@ mod tests {
target_project_id: 123,
source_project_ssh_url: Some("[email protected]:contributor/repo.git".to_string()),
source_project_http_url: Some("https://gitlab.com/contributor/repo.git".to_string()),
- target_project_ssh_url: Some("[email protected]:owner/repo.git".to_string()),
- target_project_http_url: Some("https://gitlab.com/owner/repo.git".to_string()),
+ target_project_ssh_url: None,
+ target_project_http_url: None,
is_cross_project: true,
url: "https://gitlab.com/owner/repo/-/merge_requests/101".to_string(),
};
- // HTTPS reference → HTTPS target URL
- let url = target_remote_url(&mr, "https://gitlab.com/owner/repo.git");
- assert_eq!(url, Some("https://gitlab.com/owner/repo.git".to_string()));
+ // When no target URLs are available, returns None
+ let url = target_remote_url(&mr);
+ assert_eq!(url, None);
}
}
diff --git a/src/git/pr_ref.rs b/src/git/pr_ref.rs
index b59893278..68ad9f84e 100644
--- a/src/git/pr_ref.rs
+++ b/src/git/pr_ref.rs
@@ -298,7 +298,6 @@
use anyhow::{Context, bail};
use serde::Deserialize;
-use super::GitRemoteUrl;
use super::error::GitError;
use crate::shell_exec::Cmd;
@@ -319,6 +318,8 @@ pub struct PrInfo {
pub base_repo: String,
/// Whether this is a cross-repository (fork) PR.
pub is_cross_repository: bool,
+ /// The GitHub host extracted from `html_url` (e.g., "github.com", "github.enterprise.com").
+ pub host: String,
/// The PR's web URL.
pub url: String,
}
@@ -475,6 +476,16 @@ pub fn fetch_pr_info(pr_number: u32, repo_root: &std::path::Path) -> anyhow::Res
.eq_ignore_ascii_case(&head_repo.owner.login)
|| !base_repo.name.eq_ignore_ascii_case(&head_repo.name);
+ // Extract host from html_url (e.g., "https://github.com/owner/repo/pull/123" → "github.com")
+ let host = response
+ .html_url
+ .strip_prefix("https://")
+ .or_else(|| response.html_url.strip_prefix("http://"))
+ .and_then(|s| s.split('/').next())
+ .filter(|h| !h.is_empty())
+ .with_context(|| format!("Failed to parse host from PR URL: {}", response.html_url))?
+ .to_string();
+
Ok(PrInfo {
number: pr_number,
head_ref_name: response.head.ref_name,
@@ -483,6 +494,7 @@ pub fn fetch_pr_info(pr_number: u32, repo_root: &std::path::Path) -> anyhow::Res
base_owner: base_repo.owner.login,
base_repo: base_repo.name,
is_cross_repository,
+ host,
url: response.html_url,
})
}
@@ -498,23 +510,40 @@ pub fn local_branch_name(pr: &PrInfo) -> String {
pr.head_ref_name.clone()
}
-/// Construct the remote URL for a fork, matching the protocol and host of the reference URL.
+/// Get the git protocol preference from `gh` (GitHub CLI).
+///
+/// Returns `true` for SSH if `gh config get git_protocol` returns "ssh".
+fn use_ssh_protocol() -> bool {
+ Cmd::new("gh")
+ .args(["config", "get", "git_protocol"])
+ .run()
+ .ok()
+ .filter(|output| output.status.success())
+ .map(|output| String::from_utf8_lossy(&output.stdout).trim() == "ssh")
+ .unwrap_or(false)
+}
+
+/// Construct the remote URL for a fork repository.
///
-/// If reference uses SSH (`git@host:`), returns SSH URL.
-/// If reference uses HTTPS (`https://host/`), returns HTTPS URL.
-/// Falls back to `github.com` if the reference URL cannot be parsed.
-pub fn fork_remote_url(owner: &str, repo: &str, reference_url: &str) -> String {
- let host = GitRemoteUrl::parse(reference_url)
- .map(|u| u.host().to_string())
- .unwrap_or_else(|| "github.com".to_string());
-
- if reference_url.starts_with("git@") || reference_url.contains("ssh://") {
- format!("git@{}:{}/{}.git", host, owner, repo)
+/// Uses `gh config get git_protocol` to determine SSH vs HTTPS preference.
+pub fn fork_remote_url(host: &str, owner: &str, repo: &str) -> String {
+ if use_ssh_protocol() {
+ fork_remote_url_ssh(host, owner, repo)
} else {
- format!("https://{}/{}/{}.git", host, owner, repo)
+ fork_remote_url_https(host, owner, repo)
}
}
+/// Construct an SSH-format remote URL.
+fn fork_remote_url_ssh(host: &str, owner: &str, repo: &str) -> String {
+ format!("git@{}:{}/{}.git", host, owner, repo)
+}
+
+/// Construct an HTTPS-format remote URL.
+fn fork_remote_url_https(host: &str, owner: &str, repo: &str) -> String {
+ format!("https://{}/{}/{}.git", host, owner, repo)
+}
+
/// Check if a branch is tracking a specific PR.
///
/// Returns `Some(true)` if the branch is configured to track `refs/pull/<pr_number>/head`.
@@ -554,6 +583,7 @@ mod tests {
base_owner: "owner".to_string(),
base_repo: "repo".to_string(),
is_cross_repository: false,
+ host: "github.com".to_string(),
url: "https://github.com/owner/repo/pull/101".to_string(),
};
assert_eq!(local_branch_name(&pr), "feature-auth");
@@ -571,40 +601,50 @@ mod tests {
base_owner: "owner".to_string(),
base_repo: "repo".to_string(),
is_cross_repository: true,
+ host: "github.com".to_string(),
url: "https://github.com/owner/repo/pull/101".to_string(),
};
assert_eq!(local_branch_name(&pr), "feature-auth");
}
#[test]
- fn test_fork_remote_url_ssh() {
- let url = fork_remote_url("contributor", "repo", "[email protected]:owner/repo.git");
- assert_eq!(url, "[email protected]:contributor/repo.git");
- }
-
- #[test]
- fn test_fork_remote_url_https() {
- let url = fork_remote_url("contributor", "repo", "https://github.com/owner/repo.git");
- assert_eq!(url, "https://github.com/contributor/repo.git");
+ fn test_fork_remote_url() {
+ // Protocol depends on `gh config get git_protocol`
+ let url = fork_remote_url("github.com", "contributor", "repo");
+ let valid_urls = [
+ "[email protected]:contributor/repo.git",
+ "https://github.com/contributor/repo.git",
+ ];
+ assert!(valid_urls.contains(&url.as_str()), "unexpected URL: {url}");
+
+ let url = fork_remote_url("github.example.com", "contributor", "repo");
+ let valid_urls = [
+ "[email protected]:contributor/repo.git",
+ "https://github.example.com/contributor/repo.git",
+ ];
+ assert!(valid_urls.contains(&url.as_str()), "unexpected URL: {url}");
}
#[test]
- fn test_fork_remote_url_github_enterprise_ssh() {
- let url = fork_remote_url(
- "contributor",
- "repo",
- "[email protected]:owner/repo.git",
+ fn test_fork_remote_url_formats() {
+ // Test SSH format explicitly
+ assert_eq!(
+ fork_remote_url_ssh("github.com", "contributor", "repo"),
+ "[email protected]:contributor/repo.git"
+ );
+ assert_eq!(
+ fork_remote_url_ssh("github.example.com", "org", "project"),
+ "[email protected]:org/project.git"
);
- assert_eq!(url, "[email protected]:contributor/repo.git");
- }
- #[test]
- fn test_fork_remote_url_github_enterprise_https() {
- let url = fork_remote_url(
- "contributor",
- "repo",
- "https://github.example.com/owner/repo.git",
+ // Test HTTPS format explicitly
+ assert_eq!(
+ fork_remote_url_https("github.com", "contributor", "repo"),
+ "https://github.com/contributor/repo.git"
+ );
+ assert_eq!(
+ fork_remote_url_https("github.example.com", "org", "project"),
+ "https://github.example.com/org/project.git"
);
- assert_eq!(url, "https://github.example.com/contributor/repo.git");
}
}
diff --git a/src/git/repository/branch.rs b/src/git/repository/branch.rs
index 91edfc026..773ff96cf 100644
--- a/src/git/repository/branch.rs
+++ b/src/git/repository/branch.rs
@@ -141,4 +141,24 @@ impl<'a> Branch<'a> {
let remote = push_ref.trim().split('/').next()?;
(!remote.is_empty()).then(|| remote.to_string())
}
+
+ /// Get the URL of the remote where this branch would be pushed.
+ ///
+ /// Combines [`push_remote()`](Self::push_remote) with remote URL lookup.
+ /// Returns `None` if no push remote is configured or the remote has no URL.
+ pub fn push_remote_url(&self) -> Option<String> {
+ let remote = self.push_remote()?;
+ self.repo.remote_url(&remote)
+ }
+
+ /// Get the GitHub URL for this branch's push remote, if it's a GitHub URL.
+ ///
+ /// Returns the push remote URL if configured and pointing to GitHub,
+ /// otherwise returns `None`.
+ pub fn github_push_url(&self) -> Option<String> {
+ use crate::git::GitRemoteUrl;
+ let url = self.push_remote_url()?;
+ let parsed = GitRemoteUrl::parse(&url)?;
+ parsed.is_github().then_some(url)
+ }
}
diff --git a/src/git/repository/remotes.rs b/src/git/repository/remotes.rs
index 681070c03..764c7d421 100644
--- a/src/git/repository/remotes.rs
+++ b/src/git/repository/remotes.rs
@@ -104,6 +104,27 @@ impl Repository {
self.find_remote_for_repo(parsed.owner(), parsed.repo())
}
+ /// Get all configured remote URLs.
+ ///
+ /// Returns a list of (remote_name, url) pairs for all remotes with URLs.
+ /// Useful for searching across remotes when the specific remote is unknown.
+ pub fn all_remote_urls(&self) -> Vec<(String, String)> {
+ let output = match self.run_command(&["config", "--get-regexp", r"remote\..+\.url"]) {
+ Ok(output) => output,
+ Err(_) => return Vec::new(),
+ };
+
+ output
+ .lines()
+ .filter_map(|line| {
+ // Parse "remote.<name>.url <value>" format
+ let rest = line.strip_prefix("remote.")?;
+ let (name, url) = rest.split_once(".url ")?;
+ Some((name.to_string(), url.to_string()))
+ })
+ .collect()
+ }
+
/// Get the URL for the primary remote, if configured.
///
/// Result is cached in the repository's shared cache (same for all clones).
diff --git a/src/git/url.rs b/src/git/url.rs
index f1a18e129..7bbd4b2d0 100644
--- a/src/git/url.rs
+++ b/src/git/url.rs
@@ -9,11 +9,12 @@
///
/// - `https://<host>/<owner>/<repo>.git`
/// - `http://<host>/<owner>/<repo>.git`
+/// - `git://<host>/<owner>/<repo>.git`
/// - `git@<host>:<owner>/<repo>.git`
/// - `ssh://git@<host>/<owner>/<repo>.git`
/// - `ssh://<host>/<owner>/<repo>.git`
#[derive(Debug, Clone, PartialEq, Eq)]
-pub(crate) struct GitRemoteUrl {
+pub struct GitRemoteUrl {
host: String,
owner: String,
repo: String,
@@ -45,6 +46,13 @@ impl GitRemoteUrl {
let owner = parts.next()?;
let repo = parts.next()?;
(host, owner, repo)
+ } else if let Some(rest) = url.strip_prefix("git://") {
+ // git://github.com/owner/repo.git
+ let mut parts = rest.split('/');
+ let host = parts.next()?;
+ let owner = parts.next()?;
+ let repo = parts.next()?;
+ (host, owner, repo)
} else if let Some(rest) = url.strip_prefix("ssh://") {
// ssh://[email protected]/owner/repo.git or ssh://github.com/owner/repo.git
// Note: URLs with ports (ssh://host:2222/...) are not supported here
@@ -109,6 +117,20 @@ impl GitRemoteUrl {
pub fn project_identifier(&self) -> String {
format!("{}/{}/{}", self.host, self.owner, self.repo)
}
+
+ /// Check if this URL points to a GitHub host.
+ ///
+ /// Matches github.com and GitHub Enterprise hosts (e.g., github.mycompany.com).
+ pub fn is_github(&self) -> bool {
+ self.host.to_ascii_lowercase().contains("github")
+ }
+
+ /// Check if this URL points to a GitLab host.
+ ///
+ /// Matches gitlab.com and self-hosted GitLab instances (e.g., gitlab.example.com).
+ pub fn is_gitlab(&self) -> bool {
+ self.host.to_ascii_lowercase().contains("gitlab")
+ }
}
/// Extract owner from a git remote URL.
@@ -146,6 +168,7 @@ mod tests {
#[test]
fn test_https_urls() {
let url = GitRemoteUrl::parse("https://github.com/owner/repo.git").unwrap();
+ assert_eq!(url.host(), "github.com");
assert_eq!(url.owner(), "owner");
assert_eq!(url.repo(), "repo");
assert_eq!(url.project_identifier(), "github.com/owner/repo");
@@ -198,6 +221,16 @@ mod tests {
assert_eq!(url.owner(), "owner");
}
+ #[test]
+ fn test_git_protocol_urls() {
+ let url = GitRemoteUrl::parse("git://github.com/owner/repo.git").unwrap();
+ assert_eq!(url.project_identifier(), "github.com/owner/repo");
+ assert!(url.is_github());
+
+ let url = GitRemoteUrl::parse("git://gitlab.example.com/owner/repo.git").unwrap();
+ assert!(url.is_gitlab());
+ }
+
#[test]
fn test_malformed_urls() {
assert!(GitRemoteUrl::parse("").is_none());
@@ -324,4 +357,77 @@ mod tests {
assert_eq!(url.project_identifier(), expected, "input: {input}");
}
}
+
+ #[test]
+ fn test_is_github() {
+ // GitHub.com
+ assert!(
+ GitRemoteUrl::parse("https://github.com/owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+ assert!(
+ GitRemoteUrl::parse("[email protected]:owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+ assert!(
+ GitRemoteUrl::parse("ssh://[email protected]/owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+
+ // GitHub Enterprise
+ assert!(
+ GitRemoteUrl::parse("https://github.mycompany.com/owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+
+ // Not GitHub
+ assert!(
+ !GitRemoteUrl::parse("https://gitlab.com/owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+ assert!(
+ !GitRemoteUrl::parse("https://bitbucket.org/owner/repo.git")
+ .unwrap()
+ .is_github()
+ );
+ }
+
+ #[test]
+ fn test_is_gitlab() {
+ // GitLab.com
+ assert!(
+ GitRemoteUrl::parse("https://gitlab.com/owner/repo.git")
+ .unwrap()
+ .is_gitlab()
+ );
+ assert!(
+ GitRemoteUrl::parse("[email protected]:owner/repo.git")
+ .unwrap()
+ .is_gitlab()
+ );
+
+ // Self-hosted GitLab
+ assert!(
+ GitRemoteUrl::parse("https://gitlab.example.com/owner/repo.git")
+ .unwrap()
+ .is_gitlab()
+ );
+
+ // Not GitLab
+ assert!(
+ !GitRemoteUrl::parse("https://github.com/owner/repo.git")
+ .unwrap()
+ .is_gitlab()
+ );
+ assert!(
+ !GitRemoteUrl::parse("https://bitbucket.org/owner/repo.git")
+ .unwrap()
+ .is_gitlab()
+ );
+ }
}
diff --git a/tests/integration_tests/ci_status.rs b/tests/integration_tests/ci_status.rs
index 6e7fd9ed5..53cd03a45 100644
--- a/tests/integration_tests/ci_status.rs
+++ b/tests/integration_tests/ci_status.rs
@@ -18,6 +18,27 @@ fn get_branch_sha(repo: &TestRepo, branch: &str) -> String {
repo.git_output(&["rev-parse", branch])
}
+/// Set up tracking for all branches so @{push} resolves correctly.
+///
+/// @{push} requires both tracking config AND the remote-tracking ref to exist.
+/// This is normally done by fetch/push, but in tests we create refs manually.
+fn setup_tracking_for_all_branches(repo: &TestRepo, remote: &str) {
+ for branch in ["feature", "feature-a", "feature-b", "feature-c", "main"] {
+ repo.run_git(&["config", &format!("branch.{}.remote", branch), remote]);
+ repo.run_git(&[
+ "config",
+ &format!("branch.{}.merge", branch),
+ &format!("refs/heads/{}", branch),
+ ]);
+ // Create the remote-tracking ref
+ repo.run_git(&[
+ "update-ref",
+ &format!("refs/remotes/{}/{}", remote, branch),
+ branch,
+ ]);
+ }
+}
+
/// Helper to run a CI status test with the given mock data
fn run_ci_status_test(repo: &mut TestRepo, snapshot_name: &str, pr_json: &str, run_json: &str) {
repo.setup_mock_gh_with_ci_data(pr_json, run_json);
@@ -40,6 +61,7 @@ fn setup_github_repo_with_feature(repo: &mut TestRepo) -> String {
"https://github.com/test-owner/test-repo.git",
]);
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(repo, "origin");
get_branch_sha(repo, "feature")
}
@@ -226,6 +248,7 @@ fn test_list_full_filters_by_repo_owner(mut repo: TestRepo) {
"https://github.com/my-org/test-repo.git",
]);
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(&repo, "origin");
let head_sha = get_branch_sha(&repo, "feature");
// Multiple PRs - only one from our org (should filter to my-org's PR)
@@ -254,7 +277,7 @@ fn test_list_full_filters_by_repo_owner(mut repo: TestRepo) {
#[rstest]
fn test_list_full_with_platform_override_github(mut repo: TestRepo) {
- // Set a non-GitHub remote (bitbucket) - platform won't be auto-detected
+ // Set a non-GitHub remote (bitbucket) as origin - platform won't be auto-detected
repo.run_git(&[
"remote",
"set-url",
@@ -262,6 +285,15 @@ fn test_list_full_with_platform_override_github(mut repo: TestRepo) {
"https://bitbucket.org/test-owner/test-repo.git",
]);
+ // Add a GitHub remote for PR detection (platform override needs a GitHub remote
+ // to determine which repo's PRs to check)
+ repo.run_git(&[
+ "remote",
+ "add",
+ "github",
+ "https://github.com/test-owner/test-repo.git",
+ ]);
+
// Set platform override in project config
repo.write_project_config(
r#"
@@ -270,8 +302,9 @@ platform = "github"
"#,
);
- // Create a feature branch
+ // Create a feature branch with tracking to the github remote
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(&repo, "github");
// Get actual commit SHA
let head_sha = get_branch_sha(&repo, "feature");
@@ -344,8 +377,9 @@ platform = "invalid_platform"
"#,
);
- // Create a feature branch
+ // Create a feature branch with tracking
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(&repo, "origin");
let head_sha = get_branch_sha(&repo, "feature");
// Setup mock gh - platform should fall back to GitHub via URL detection
@@ -405,6 +439,7 @@ fn setup_gitlab_repo_with_feature(repo: &mut TestRepo) -> String {
"https://gitlab.com/test-group/test-project.git",
]);
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(repo, "origin");
get_branch_sha(repo, "feature")
}
@@ -490,6 +525,7 @@ fn test_list_full_with_gitlab_filters_by_project_id(mut repo: TestRepo) {
"https://gitlab.com/my-group/my-project.git",
]);
repo.add_worktree("feature");
+ setup_tracking_for_all_branches(&repo, "origin");
let head_sha = get_branch_sha(&repo, "feature");
// Multiple MRs - only one from our project (should filter to project 99999)
diff --git a/tests/snapshots/integration__integration_tests__ci_status__filters_by_repo_owner.snap b/tests/snapshots/integration__integration_tests__ci_status__filters_by_repo_owner.snap
index 7deceb581..109502a22 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__filters_by_repo_owner.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__filters_by_repo_owner.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_pr_conflicts.snap b/tests/snapshots/integration__integration_tests__ci_status__github_pr_conflicts.snap
index df9f9fe1b..3119ad126 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_pr_conflicts.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_pr_conflicts.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap b/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
index 5f23995d2..9f7a8403c 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_pr_failed.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_pr_passed.snap b/tests/snapshots/integration__integration_tests__ci_status__github_pr_passed.snap
index 7deceb581..109502a22 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_pr_passed.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_pr_passed.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_pr_running.snap b/tests/snapshots/integration__integration_tests__ci_status__github_pr_running.snap
index a91f9ed05..1218c1fc9 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_pr_running.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_pr_running.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_workflow_run.snap b/tests/snapshots/integration__integration_tests__ci_status__github_workflow_run.snap
index 34ceba347..cfe20836e 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_workflow_run.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_workflow_run.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__github_workflow_running.snap b/tests/snapshots/integration__integration_tests__ci_status__github_workflow_running.snap
index 34ceba347..cfe20836e 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__github_workflow_running.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__github_workflow_running.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_filters_by_project_id.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_filters_by_project_id.snap
index 7deceb581..109502a22 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_filters_by_project_id.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_filters_by_project_id.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_conflicts.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_conflicts.snap
index df9f9fe1b..3119ad126 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_conflicts.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_conflicts.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_failed.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_failed.snap
index 5f23995d2..9f7a8403c 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_failed.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_failed.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_passed.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_passed.snap
index 7deceb581..109502a22 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_passed.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_passed.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
index a91f9ed05..1218c1fc9 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_pending.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
index a91f9ed05..1218c1fc9 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_mr_running.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_no_ci.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_no_ci.snap
index 2163050a0..79cffa5ae 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_no_ci.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_no_ci.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__gitlab_stale_mr.snap b/tests/snapshots/integration__integration_tests__ci_status__gitlab_stale_mr.snap
index c4dfda3e7..e4104e806 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__gitlab_stale_mr.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__gitlab_stale_mr.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
-+ feature ↑ ↑1 +1 ../repo.feature ● da7d235a 1d Local commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
++ feature ↑⇡ ↑1 +1 ../repo.feature ⇡1 ● da7d235a 1d Local commit
○ Showing 5 worktrees, 4 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__list_full_with_invalid_platform_override.snap b/tests/snapshots/integration__integration_tests__ci_status__list_full_with_invalid_platform_override.snap
index b3e3228bc..c990ec35f 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__list_full_with_invalid_platform_override.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__list_full_with_invalid_platform_override.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ? ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 1 with changes, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__list_full_with_platform_override_github.snap b/tests/snapshots/integration__integration_tests__ci_status__list_full_with_platform_override_github.snap
index 100183470..8970b6938 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__list_full_with_platform_override_github.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__list_full_with_platform_override_github.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ? ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 1 with changes, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__mixed_check_types.snap b/tests/snapshots/integration__integration_tests__ci_status__mixed_check_types.snap
index a91f9ed05..1218c1fc9 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__mixed_check_types.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__mixed_check_types.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__no_ci_checks.snap b/tests/snapshots/integration__integration_tests__ci_status__no_ci_checks.snap
index 2163050a0..79cffa5ae 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__no_ci_checks.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__no_ci_checks.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap b/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
index c4dfda3e7..e4104e806 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__stale_pr.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
-+ feature ↑ ↑1 +1 ../repo.feature ● da7d235a 1d Local commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
++ feature ↑⇡ ↑1 +1 ../repo.feature ⇡1 ● da7d235a 1d Local commit
○ Showing 5 worktrees, 4 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__status_context_failure.snap b/tests/snapshots/integration__integration_tests__ci_status__status_context_failure.snap
index 5f23995d2..9f7a8403c 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__status_context_failure.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__status_context_failure.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead
diff --git a/tests/snapshots/integration__integration_tests__ci_status__status_context_pending.snap b/tests/snapshots/integration__integration_tests__ci_status__status_context_pending.snap
index a91f9ed05..1218c1fc9 100644
--- a/tests/snapshots/integration__integration_tests__ci_status__status_context_pending.snap
+++ b/tests/snapshots/integration__integration_tests__ci_status__status_context_pending.snap
@@ -13,6 +13,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -26,7 +27,7 @@ info:
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_DELAYED_STREAM_MS: "999999"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -34,10 +35,10 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ main…± Path Remote⇅ CI Commit Age Message
@ main ^| . | ● 05a4a45d 16h Initial commit
-+ feature _ ../repo.feature ● 05a4a45d 16h Initial commit
-+ feature-a ↑ ↑1 +1 ../repo.feature-a ● 1b87d473 16h Add feature-a file
-+ feature-b ↑ ↑1 +1 ../repo.feature-b ● f62940fc 16h Add feature-b file
-+ feature-c ↑ ↑1 +1 ../repo.feature-c ● 345c7c93 16h Add feature-c file
++ feature _| ../repo.feature | ● 05a4a45d 16h Initial commit
++ feature-a ↑| ↑1 +1 ../repo.feature-a | ● 1b87d473 16h Add feature-a file
++ feature-b ↑| ↑1 +1 ../repo.feature-b | ● f62940fc 16h Add feature-b file
++ feature-c ↑| ↑1 +1 ../repo.feature-c | ● 345c7c93 16h Add feature-c file
○ Showing 5 worktrees, 3 ahead