pub struct WorktreeConfig {
pub mode: WorktreeMode,
pub base_dir: PathBuf,
pub prefix: String,
pub auto_gitignore: bool,
pub default_editor: String,
pub cleanup: WorktreeCleanupConfig,
pub merge_detection: WorktreeMergeDetectionConfig,
pub status: WorktreeStatusConfig,
}Expand description
Configuration for worktree management
Fields§
§mode: WorktreeModeWorktree storage mode (local or global)
base_dir: PathBufBase directory for worktrees
- Local mode: relative to repo root (e.g., “.worktrees”)
- Global mode: absolute path or relative to workspace root
prefix: StringDefault branch prefix for managed worktrees
auto_gitignore: boolAutomatically manage .gitignore for worktree directories
default_editor: StringDefault editor command for opening worktrees
cleanup: WorktreeCleanupConfigCleanup configuration
merge_detection: WorktreeMergeDetectionConfigMerge detection configuration
status: WorktreeStatusConfigStatus display configuration
Implementations§
Source§impl WorktreeConfig
impl WorktreeConfig
Sourcepub fn get_resolved_base_dir(&self, repo_root: Option<&Path>) -> PathBuf
pub fn get_resolved_base_dir(&self, repo_root: Option<&Path>) -> PathBuf
Get the resolved base directory based on mode and configuration
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load configuration from environment variables, falling back to defaults
Sourcepub fn load_with_overrides() -> Result<Self, String>
pub fn load_with_overrides() -> Result<Self, String>
Load configuration with environment variable overrides and validation
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Enhanced validation with more comprehensive checks
Sourcepub fn get_help_text() -> &'static str
pub fn get_help_text() -> &'static str
Get configuration documentation for help system
Sourcepub fn sample_config_yaml() -> String
pub fn sample_config_yaml() -> String
Create a sample configuration for documentation
Trait Implementations§
Source§impl Clone for WorktreeConfig
impl Clone for WorktreeConfig
Source§fn clone(&self) -> WorktreeConfig
fn clone(&self) -> WorktreeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorktreeConfig
impl Debug for WorktreeConfig
Source§impl Default for WorktreeConfig
impl Default for WorktreeConfig
Source§impl<'de> Deserialize<'de> for WorktreeConfig
impl<'de> Deserialize<'de> for WorktreeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorktreeConfig
impl RefUnwindSafe for WorktreeConfig
impl Send for WorktreeConfig
impl Sync for WorktreeConfig
impl Unpin for WorktreeConfig
impl UnsafeUnpin for WorktreeConfig
impl UnwindSafe for WorktreeConfig
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