GitBaby/src/remote/types.rs
zhenyi 680411c4fb chore: initialize gitbaby repository
gitbaby is an asynchronous Rust library wrapping git operations, built on
gix + tokio + async-trait.

Module layout:
- archive, blame, blob, branch, cleanup, commit, compare, config,
  conflict, diff, merge, refs, remote, setup, share, submodule, tags,
  tree (feature modules)
- command: command scheduler (cmd/env/pipe/context/error)
- repo: RepositoryFacade trait (consumers implement, exposing a
  gix::Repository)

Features:
- async API on tokio 1.53
- order-preserving Env (Vec<(String, String)>)
- hand-written BabyError / CmdError, not using thiserror derive
- integration tests covering cmd_run / context / env / pipe (env keys
  prefixed for isolation)

CI: none, standard cargo build / test / clippy / fmt only
2026-08-14 18:10:04 +08:00

36 lines
858 B
Rust

#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum RemoteOption {
#[default]
Default,
MirrorPush,
MirrorFetch,
}
impl RemoteOption {
pub fn as_arg(self) -> crate::share::RemoteMirror {
match self {
Self::Default => crate::share::RemoteMirror::Default,
Self::MirrorPush => crate::share::RemoteMirror::Push,
Self::MirrorFetch => crate::share::RemoteMirror::Fetch,
}
}
}
#[derive(Debug, Clone)]
pub struct UpdateRemoteMirrorRequest {
pub url: String,
pub refs: Vec<String>,
pub only_branches_matching: Vec<String>,
pub keep_divergent_refs: bool,
}
#[derive(Debug, Clone, Default)]
pub struct UpdateRemoteMirrorResult {
pub divergent_refs: Vec<String>,
}
#[derive(Debug, Clone, Default)]
pub struct FetchRemoteCommitResult {
pub fetched: bool,
}