GitBaby/src/config/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

26 lines
520 B
Rust

use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ConfigEntry {
pub key: String,
pub value: String,
}
impl fmt::Display for ConfigEntry {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}={}", self.key, self.value)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ConfigScope(pub String);
impl ConfigScope {
pub fn global() -> Self {
Self("global".to_string())
}
pub fn local() -> Self {
Self("local".to_string())
}
}