chore: restructure backend
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-28 09:06:13 +07:00
parent 44c2dc6345
commit 71bbcfaf51
35 changed files with 1781 additions and 2214 deletions
+1 -19
View File
@@ -8,16 +8,13 @@ mod scan;
mod sync;
mod worktree;
#[cfg(test)]
mod tests;
pub use cache::GitCache;
pub use diff::{CommitDiff, DiffHunk, DiffLine, DiffLineKind, DiffStatus, FileDiff};
pub use history::{CommitList, FileCommit, MAX_LISTED_COMMITS};
pub use nip34::{GraspSignals, Nip34Binding, Nip34Kind};
pub use patch::PatchParser;
pub use repo::{Repo, RepoRefState};
pub use scan::{LocalRepo, find_git_repos};
pub use scan::LocalRepo;
pub use sync::{RefSync, RepoSyncStatus};
pub use worktree::WorktreeSnapshot;
@@ -34,18 +31,3 @@ where
self.map_err(|exn| anyhow::Error::from(exn.into_error()))
}
}
#[cfg(test)]
fn git_in(dir: &std::path::Path, args: &[&str]) -> anyhow::Result<String> {
let output = Repo::run_git(dir, args, "git")?;
if !output.status.success() {
anyhow::bail!(
"git {} failed: {}",
args.join(" "),
String::from_utf8_lossy(&output.stderr).trim()
);
}
Ok(String::from_utf8_lossy(&output.stdout).trim().to_owned())
}