Sebastian Thielj fmtc3c65041 year agoHistory
29 lines · 798 B · Rust
RawDownload
use anyhow::bail; use crate::OutputFormat; pub fn list(repo: gix::Repository, out: &mut dyn std::io::Write, format: OutputFormat) -> anyhow::Result<()> {    if format != OutputFormat::Human {        bail!("JSON output isn't implemented yet");    }     if let Some(worktree) = repo.worktree() {        writeln!(            out,            "{base} [{branch}]",            base = gix::path::realpath(worktree.base())?.display(),            branch = repo                .head_name()?                .map_or("<detached>".into(), |name| name.shorten().to_owned()),        )?;    }    for proxy in repo.worktrees()? {        writeln!(            out,            "{base} [{name}]",            base = proxy.base()?.display(),            name = proxy.id()        )?;    }    Ok(())}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t