Update dependencies, improve CLI asset generation, and add man page

- Bump `git2` from 0.20.4 to 0.21.0 and `rusqlite` from 0.39.0 to 0.40.1 in Cargo.toml.
- Refactor CLI asset generation in `cli_assets.rs` to write a man page directly instead of generating it with `clap_mangen`.
- Implement a function to remove old man pages before writing the new one.
- Add tests to ensure the generated man page documents all visible command paths.
- Update the install script to copy the newly generated man page correctly.
- Introduce a new man page for the `depot` command with comprehensive documentation.
This commit is contained in:
2026-06-10 06:33:39 -05:00
parent 65cec6903a
commit 5b23ea95e0
7 changed files with 783 additions and 359 deletions
+5 -5
View File
@@ -170,7 +170,7 @@ fn apply_cherry_picks(repo: &Repository, cherry_pick_revs: &[String]) -> Result<
let tree = repo
.find_tree(tree_id)
.with_context(|| format!("Failed to find tree after cherry-pick {}", rev))?;
let message = commit.summary().unwrap_or("cherry-pick");
let message = commit.summary().ok().flatten().unwrap_or("cherry-pick");
let new_head = repo
.commit(
None,
@@ -336,7 +336,7 @@ fn repair_mirror_refs(repo: &Repository) -> Result<()> {
fn sync_remote_tracking_heads(repo: &Repository) -> Result<()> {
for reference_result in repo.references_glob("refs/remotes/origin/*")? {
let reference = reference_result?;
let Some(name) = reference.name() else {
let Ok(name) = reference.name() else {
continue;
};
if name == "refs/remotes/origin/HEAD" {
@@ -368,7 +368,7 @@ fn ensure_valid_local_head(repo: &Repository) -> Result<()> {
let mut candidates: Vec<String> = Vec::new();
for reference_result in repo.references_glob("refs/heads/*")? {
let reference = reference_result?;
let Some(name) = reference.name() else {
let Ok(name) = reference.name() else {
continue;
};
candidates.push(name.to_string());
@@ -517,7 +517,7 @@ fn resolve_remote_head_like<'a>(repo: &'a Repository) -> Result<Option<git2::Obj
let mut candidates: Vec<(String, Oid)> = Vec::new();
for reference_result in repo.references_glob("refs/remotes/origin/*")? {
let reference = reference_result?;
let Some(name) = reference.name() else {
let Ok(name) = reference.name() else {
continue;
};
if name == "refs/remotes/origin/HEAD" {
@@ -1049,7 +1049,7 @@ mod tests {
assert_eq!(
repo.head().unwrap().resolve().unwrap().name(),
Some("refs/heads/main")
Ok("refs/heads/main")
);
}