git: match native agent workflows

This commit is contained in:
2026-11-06 19:07:28 +00:00
parent b5462cc366
commit 6daa53cca4
11 changed files with 1641 additions and 75 deletions
+21 -1
View File
@@ -36,6 +36,19 @@ pub(crate) fn commit(commit: &gix::Commit<'_>) -> crate::Result<()> {
);
Ok(())
}
pub(crate) fn author_date(commit: &gix::Commit<'_>) -> crate::Result<()> {
let author = commit
.author()
.map_err(|e| crate::repo::error("author", e))?;
println!(
" Date: {}",
author
.time()
.map_err(|e| crate::repo::error("date", e))?
.format_or_unix(gix::date::time::format::DEFAULT)
);
Ok(())
}
pub(crate) fn long_status(s: &Status) {
let branch = s
.head
@@ -43,7 +56,14 @@ pub(crate) fn long_status(s: &Status) {
.as_deref()
.unwrap_or("HEAD")
.trim_start_matches("refs/heads/");
println!("On branch {branch}");
if s.head.detached {
println!(
"HEAD detached at {}",
&s.head.id.as_deref().unwrap_or("HEAD")[..7]
);
} else {
println!("On branch {branch}");
}
if s.head.unborn {
println!("\nNo commits yet\n");
}