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;
25pub use merge::SquashMergeOutcome;
26pub(crate) use merge::{squash_merge, squash_merge_diff};
27pub use rebase::{InProgressGitOperation, RebaseStepResult};
28pub(crate) use rebase::{
29    abort_rebase, has_unmerged_paths, in_progress_operation, is_rebase_in_progress,
30    list_conflicted_files, list_staged_conflict_marker_files, rebase, rebase_continue,
31    rebase_onto_start, rebase_start,
32};
33pub(crate) use repo::{main_repo_root, repo_url};
34#[cfg(test)]
35pub(crate) use sleeper::MockSleeper;
36pub(crate) use sleeper::{Sleeper, ThreadSleeper};
37pub use sync::{BranchTrackingMap, PullRebaseResult, SingleCommitMessageStrategy};
38pub(crate) use sync::{
39    branch_tracking_statuses, commit_all, commit_all_preserving_single_commit,
40    current_upstream_reference, delete_branch, diff, fetch_remote, get_ahead_behind,
41    get_ref_ahead_behind, has_commits_since, head_commit_message, head_hash, head_short_hash,
42    is_worktree_clean, list_local_commit_titles, list_upstream_commit_titles, pull_rebase,
43    push_current_branch, push_current_branch_to_remote_branch, ref_hash, remote_branch_exists,
44    stage_all, tracked_worktree_status, worktree_status,
45};
46pub(crate) use worktree::{create_worktree, detect_git_info, find_git_repo_root, remove_worktree};