git: match native agent workflows
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user