Skip to main content

wt/git/
mod.rs

1//! The Git boundary (spec §4): `gix` for reads, the `git` CLI for mutations and
2//! network operations. Submodules:
3//!
4//! - [`cli`] — the [`GitCli`] subprocess trait + [`RealGit`].
5//! - `merged` — content-level merge detection (squash and rebase merges).
6//! - `ops` — verb-named wrappers over [`GitCli`] for shared mutations.
7//! - [`discover`] — repository discovery and identity via `gix`.
8//! - [`porcelain`] — pure parsers for `git` porcelain output.
9//! - [`submodule`] — submodule detection (`status`) and init (`update --init`).
10//! - [`worktrees`] — worktree enumeration + missing detection.
11
12pub mod aheadbehind;
13pub mod cli;
14pub mod commit;
15pub mod discover;
16pub(crate) mod merged;
17pub(crate) mod ops;
18pub mod porcelain;
19pub mod refs;
20pub mod status;
21pub mod submodule;
22pub mod worktrees;
23
24pub(crate) use aheadbehind::ahead_behind;
25pub use cli::{GitCli, GitOutput, RealGit};
26pub(crate) use commit::{CommitInfo, abbrev_len, commit_info, recent_commits};
27pub(crate) use refs::{
28    Upstream, branch_ref, default_branch, is_ancestor, local_branches, resolve_hex, upstream_of,
29    validate_branch_name,
30};
31// Only the command handlers reach for these; the core library does not.
32// `default_base_ref` moved here from the TUI group when `wt issue` (a CLI
33// command) started resolving its base from `origin/HEAD`.
34#[cfg(feature = "cli")]
35pub(crate) use refs::{
36    all_branches, current_branch, default_base_ref, default_tracking_ref, remote_branches,
37};
38// Only the TUI reaches for this.
39#[cfg(feature = "tui")]
40pub(crate) use refs::origin_head_branch;
41// Only prune reaches for this.
42#[cfg(feature = "cli")]
43pub(crate) use status::is_clean_for_removal;
44pub(crate) use status::status_of;
45pub(crate) use worktrees::enumerate;