userland/git: git-compatible CLI on v2's gix code (T10)

Local workflow, smart-HTTP clone/fetch/push and public HTTPS clone/fetch match
native git in stdout and exit codes. Only WASI imports (wasi:http, exit-with-code).
This commit is contained in:
2026-11-06 16:07:57 +00:00
parent 0fae0f9b10
commit 4b27e9afd5
204 changed files with 37736 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
/// Read HEAD without mistaking an unborn branch for an I/O error.
fn head_info(repo: &gix::Repository) -> Result<HeadInfo> {
let head = repo.head().map_err(|e| error("HEAD", e))?;
Ok(HeadInfo { detached: head.is_detached(), unborn: head.is_unborn(),
branch: head.referent_name().map(|name| name.as_bstr().to_str_lossy().into_owned()),
id: head.id().map(|id| id.to_string()) })
}