pub struct GitAdapter { /* private fields */ }Expand description
Git adapter implementing branch-based workflow
Features:
- Automatic feature branch creation
- Git commit with PR metadata
- Push to remote
- GitHub/GitLab PR creation via gh/glab CLI
Implementations§
Source§impl GitAdapter
impl GitAdapter
Sourcepub const BUILTIN_LOCK_FILES: &'static [&'static str]
pub const BUILTIN_LOCK_FILES: &'static [&'static str]
Built-in lock files that are always auto-staged when modified (v0.14.3.7).
These are deterministic outputs of the build process — when a version bump or dependency change occurs, the lock file regenerates and must be committed together with the source change to keep the tree self-consistent.
Sourcepub fn new(work_dir: impl Into<PathBuf>) -> Self
pub fn new(work_dir: impl Into<PathBuf>) -> Self
Create a new GitAdapter for the given working directory
Sourcepub fn with_config(work_dir: impl Into<PathBuf>, config: SubmitConfig) -> Self
pub fn with_config(work_dir: impl Into<PathBuf>, config: SubmitConfig) -> Self
Create a new GitAdapter with explicit configuration
Sourcepub fn with_full_config(
work_dir: impl Into<PathBuf>,
config: SubmitConfig,
sync_config: SyncConfig,
) -> Self
pub fn with_full_config( work_dir: impl Into<PathBuf>, config: SubmitConfig, sync_config: SyncConfig, ) -> Self
Create a new GitAdapter with submit and sync configuration
Sourcepub fn with_plan_file(self, plan_file: impl Into<String>) -> Self
pub fn with_plan_file(self, plan_file: impl Into<String>) -> Self
Set the plan file name (relative to work_dir). Default: “PLAN.md”.
Sourcepub fn current_branch(&self) -> Result<String>
pub fn current_branch(&self) -> Result<String>
Get current branch name
Trait Implementations§
Source§impl SourceAdapter for GitAdapter
impl SourceAdapter for GitAdapter
Source§fn prepare(&self, goal: &GoalRun, config: &SubmitConfig) -> Result<()>
fn prepare(&self, goal: &GoalRun, config: &SubmitConfig) -> Result<()>
Create a working branch/changelist/workspace for this goal Read more
Source§fn commit(
&self,
goal: &GoalRun,
pr: &DraftPackage,
message: &str,
) -> Result<CommitResult>
fn commit( &self, goal: &GoalRun, pr: &DraftPackage, message: &str, ) -> Result<CommitResult>
Commit the approved changes from staging Read more
Source§fn open_review(&self, goal: &GoalRun, pr: &DraftPackage) -> Result<ReviewResult>
fn open_review(&self, goal: &GoalRun, pr: &DraftPackage) -> Result<ReviewResult>
Open a review request Read more
Source§fn exclude_patterns(&self) -> Vec<String>
fn exclude_patterns(&self) -> Vec<String>
Patterns to exclude from staging copy (VCS metadata dirs, etc.) Read more
Source§fn sync_upstream(&self) -> Result<SyncResult>
fn sync_upstream(&self) -> Result<SyncResult>
Sync the local workspace with upstream changes. Read more
Source§fn save_state(&self) -> Result<Option<SavedVcsState>>
fn save_state(&self) -> Result<Option<SavedVcsState>>
Save working state before apply operations. Read more
Source§fn restore_state(&self, state: Option<SavedVcsState>) -> Result<()>
fn restore_state(&self, state: Option<SavedVcsState>) -> Result<()>
Restore working state after apply operations. Read more
Source§fn current_branch(&self) -> Result<String>
fn current_branch(&self) -> Result<String>
Get the current branch or workspace name. Read more
Source§fn revision_id(&self) -> Result<String>
fn revision_id(&self) -> Result<String>
Get the current revision identifier for the working directory. Read more
Source§fn protected_submit_targets(&self) -> Vec<String>
fn protected_submit_targets(&self) -> Vec<String>
Protected submit targets for this adapter (§15 VCS Submit Invariant). Read more
Source§fn verify_not_on_protected_target(&self) -> Result<()>
fn verify_not_on_protected_target(&self) -> Result<()>
Assert the post-
prepare() invariant: the adapter must not be
positioned to commit directly to a protected target (§15). Read moreSource§fn stage_env(
&self,
staging_dir: &Path,
config: &VcsAgentConfig,
) -> Result<HashMap<String, String>>
fn stage_env( &self, staging_dir: &Path, config: &VcsAgentConfig, ) -> Result<HashMap<String, String>>
Produce environment variables to inject into the agent process so it
operates on the staging directory instead of the developer’s real VCS
workspace (v0.13.17.3). Read more
Source§fn check_review(&self, review_id: &str) -> Result<Option<ReviewStatus>>
fn check_review(&self, review_id: &str) -> Result<Option<ReviewStatus>>
Check the status of a review/PR by its review ID (e.g., PR number). Read more
Source§fn merge_review(&self, review_id: &str) -> Result<MergeResult>
fn merge_review(&self, review_id: &str) -> Result<MergeResult>
Merge a review/PR into the target branch and sync the local workspace. Read more
Auto Trait Implementations§
impl Freeze for GitAdapter
impl RefUnwindSafe for GitAdapter
impl Send for GitAdapter
impl Sync for GitAdapter
impl Unpin for GitAdapter
impl UnsafeUnpin for GitAdapter
impl UnwindSafe for GitAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more