Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Only check CI for branches with upstream tracking configured
Maximilian Roos6273ccdb641a
diff --git a/docs/content/list.md b/docs/content/list.mdindex 720d22581..3e027e141 100644--- a/docs/content/list.md+++ b/docs/content/list.md@@ -95,9 +95,9 @@ The CI column shows GitHub/GitLab pipeline status:| <span style='color:#a00'>●</span> red | Checks failed || <span style='color:#a60'>●</span> yellow | Merge conflicts with base || <span style='color:#888'>●</span> gray | No checks configured |-| (blank) | No PR/MR found |+| (blank) | No upstream or no PR/MR |-Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.+CI is only checked for branches that track a remote — local-only branches show blank. Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.## Status symbolsdiff --git a/src/cli.rs b/src/cli.rsindex 63aa1fbaa..995533b57 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -1406,9 +1406,9 @@ The CI column shows GitHub/GitLab pipeline status:| `●` red | Checks failed || `●` yellow | Merge conflicts with base || `●` gray | No checks configured |-| (blank) | No PR/MR found |+| (blank) | No upstream or no PR/MR |-Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.+CI is only checked for branches that track a remote — local-only branches show blank. Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.## Status symbolsdiff --git a/src/commands/list/collect_progressive_impl.rs b/src/commands/list/collect_progressive_impl.rsindex 7b6f7617d..679c27fa9 100644--- a/src/commands/list/collect_progressive_impl.rs+++ b/src/commands/list/collect_progressive_impl.rs@@ -395,21 +395,29 @@ impl Task for UpstreamTask {}/// Task 10: CI/PR status+///+/// Only checks CI for branches that have an upstream tracking branch configured.+/// This prevents false matches from similarly-named branches on the remote that+/// aren't actually related to the local branch.pub struct CiStatusTask;impl Task for CiStatusTask {const KIND: TaskKind = TaskKind::CiStatus;fn compute(ctx: TaskContext) -> TaskResult {- let repo_path = Repository::at(&ctx.repo_path)+ let repo = Repository::at(&ctx.repo_path);+ let repo_path = repo.worktree_root().ok().unwrap_or_else(|| ctx.repo_path.clone());- let pr_status = ctx- .branch- .as_deref()- .and_then(|branch| PrStatus::detect(branch, &ctx.commit_sha, &repo_path));+ let pr_status = ctx.branch.as_deref().and_then(|branch| {+ // Only check CI for branches with an upstream configured.+ // This prevents showing CI for old branches that happen to have+ // same-named branches on the remote but aren't tracking them.+ repo.upstream_branch(branch).ok().flatten()?;+ PrStatus::detect(branch, &ctx.commit_sha, &repo_path)+ });TaskResult::CiStatus {item_idx: ctx.item_idx,diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snapindex 7b296a72e..54a94167b 100644--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap@@ -104,9 +104,9 @@ The CI column shows GitHub/GitLab pipeline status:[31m●[0m red Checks failed[33m●[0m yellow Merge conflicts with base[90m●[0m gray No checks configured- (blank) No PR/MR found+ (blank) No upstream or no PR/MR-Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.+CI is only checked for branches that track a remote — local-only branches show blank. Any CI dot appears dimmed when there are unpushed local changes (stale status). CI indicators are clickable links to the PR page.[32mStatus symbols[0m