Skip to main content

ag_git/
lib.rs

1//! Reusable git, worktree, sync, rebase, and squash-merge orchestration.
2
3/// Client boundary and production adapter implementations.
4mod client;
5/// Typed error types for git infrastructure operations.
6mod error;
7/// Squash-merge workflows.
8mod merge;
9/// Rebase and conflict workflows.
10mod rebase;
11/// Repository-level helpers and metadata operations.
12mod repo;
13/// Sleep boundary for retry behavior.
14mod sleeper;
15/// Commit, diff, and remote synchronization workflows.
16mod sync;
17/// Worktree and branch-detection workflows.
18mod worktree;
19
20#[cfg(any(test, feature = "test-utils"))]
21pub use client::MockGitClient;
22pub use client::{GitClient, GitFuture, RealGitClient};
23/// Re-exported typed error for git infrastructure operations.
24pub use error::GitError;
25/// Re-exported squash-merge APIs.
26pub use merge::{SquashMergeOutcome, squash_merge, squash_merge_diff};
27/// Re-exported rebase/conflict APIs.
28pub use rebase::{
29    RebaseStepResult, abort_rebase, has_unmerged_paths, is_rebase_in_progress,
30    list_conflicted_files, list_staged_conflict_marker_files, rebase, rebase_continue,
31    rebase_onto_start, rebase_start,
32};
33/// Re-exported repository metadata APIs.
34pub use repo::{main_repo_root, repo_url};
35#[cfg(test)]
36pub(crate) use sleeper::MockSleeper;
37pub(crate) use sleeper::{Sleeper, ThreadSleeper};
38/// Re-exported commit/sync/diff APIs.
39pub use sync::{
40    BranchTrackingMap, PullRebaseResult, SingleCommitMessageStrategy, branch_tracking_statuses,
41    commit_all, commit_all_preserving_single_commit, current_upstream_reference, delete_branch,
42    diff, fetch_remote, get_ahead_behind, get_ref_ahead_behind, has_commits_since,
43    head_commit_message, head_hash, head_short_hash, is_worktree_clean, list_local_commit_titles,
44    list_upstream_commit_titles, pull_rebase, push_current_branch,
45    push_current_branch_to_remote_branch, ref_hash, remote_branch_exists, stage_all,
46    tracked_worktree_status, worktree_status,
47};
48/// Re-exported worktree and branch-detection APIs.
49pub use worktree::{create_worktree, detect_git_info, find_git_repo_root, remove_worktree};