pub enum IssueRef {
GitHub {
owner: String,
repo: String,
number: u64,
},
Linear {
owner: String,
repo: String,
id: String,
},
AzureDevOps {
org: String,
project: String,
repo: String,
id: u64,
},
Jira {
host: String,
issue_key: String,
owner: String,
repo: String,
},
GitLab {
owner: String,
repo: String,
number: u64,
},
Adhoc {
owner: String,
repo: String,
name: String,
},
Local {
project_path: PathBuf,
display_number: u32,
},
RemoteBranch {
host: String,
owner: String,
repo: String,
branch: String,
},
}Expand description
A reference to an issue that identifies a workspace.
Variants§
GitHub
A GitHub issue identified by owner, repo, and number.
Fields
Linear
A Linear issue identified by its UUID, paired with the GitHub repo that hosts the code for that project.
Fields
AzureDevOps
An Azure DevOps work item paired with an Azure Repos git repository.
Fields
Jira
A Jira issue paired with a GitHub repo that hosts the code.
Fields
GitLab
A GitLab issue identified by owner, repo, and number.
Fields
Adhoc
A bare repo opened without a specific issue — random branch name.
Fields
Local
A local Centy issue — the repository itself is the source, no remote clone needed.
Fields
RemoteBranch
A repo detected from the current directory’s git remote — just repo + branch.
Implementations§
Source§impl IssueRef
impl IssueRef
Sourcepub fn workspace_dir_name(&self) -> String
pub fn workspace_dir_name(&self) -> String
Directory name used inside the bare clone for this worktree.
Sourcepub fn branch_name(&self) -> String
pub fn branch_name(&self) -> String
Git branch name for this issue worktree.
Sourcepub fn clone_url(&self) -> String
pub fn clone_url(&self) -> String
HTTPS clone URL for the repository.
§Panics
Always panics for IssueRef::Local — local repos are never cloned.
Sourcepub fn multi_dir_name(&self) -> String
pub fn multi_dir_name(&self) -> String
Subdirectory name within a multi-workspace root: <repo>-<id>.
For example, GitHub { repo: "backend", number: 7 } → "backend-7".
§Panics
Panics for IssueRef::Local — local issues are not supported in
multi-workspace mode.
Source§impl IssueRef
impl IssueRef
Sourcepub fn from_current_repo() -> Result<Self>
pub fn from_current_repo() -> Result<Self>
Detect the repository from the current working directory.
Reads the origin remote URL and current branch, then creates
an Self::RemoteBranch.
§Errors
Returns an error if the current directory is not inside a git
repository, has no origin remote, or the remote URL is not a
recognised GitHub or GitLab URL.
Source§impl IssueRef
impl IssueRef
Sourcepub fn parse_with_options(s: &str) -> Result<(Self, DeepLinkOptions)>
pub fn parse_with_options(s: &str) -> Result<(Self, DeepLinkOptions)>
Like [parse] but also returns any DeepLinkOptions embedded in a
worktree:// URL (e.g. the editor query param).
§Errors
Returns an error if s cannot be parsed as a valid issue reference.
Source§impl IssueRef
impl IssueRef
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Parse any of the supported input formats:
https://github.com/owner/repo/issues/42worktree://open?owner=X&repo=Y&issue=42worktree://open?url=<encoded-github-url>worktree://open?owner=X&repo=Y&linear_id=<uuid>owner/repo#42owner/repo@<linear-uuid>centy:<number>(context-aware: finds nearest.centy/ancestor)gh:<number>(context-aware: resolves against theoriginGitHub remote)owner/repo(ad-hoc: auto-generates a random branch name)
§Errors
Returns an error if s does not match any supported format or if the
extracted values (e.g. issue number) are invalid.
Source§impl IssueRef
impl IssueRef
Sourcepub fn temp_path(&self) -> PathBuf
pub fn temp_path(&self) -> PathBuf
Path to the worktree checkout.
For Local: ~/worktrees/local/{project_name}/issue-{display_number}
For others: ~/worktrees/github/{owner}/{repo}/issue-N
Sourcepub fn bare_clone_path(&self) -> PathBuf
pub fn bare_clone_path(&self) -> PathBuf
Path to the bare clone (or the local repo itself for Local).
§Panics
Panics if the home directory cannot be determined.