pub struct GitManager { /* private fields */ }Expand description
Git操作を管理する構造体
Implementations§
Source§impl GitManager
impl GitManager
Sourcepub fn new(repo_path: &Path) -> TwinResult<Self>
pub fn new(repo_path: &Path) -> TwinResult<Self>
新しいGitManagerインスタンスを作成
Sourcepub fn set_dry_run(&mut self, dry_run: bool)
pub fn set_dry_run(&mut self, dry_run: bool)
ドライランモードを設定
Sourcepub fn add_worktree(
&mut self,
path: &Path,
branch: Option<&str>,
create_branch: bool,
) -> TwinResult<WorktreeInfo>
pub fn add_worktree( &mut self, path: &Path, branch: Option<&str>, create_branch: bool, ) -> TwinResult<WorktreeInfo>
Worktreeを追加
Sourcepub fn add_worktree_with_options(&mut self, args: &[&str]) -> TwinResult<Output>
pub fn add_worktree_with_options(&mut self, args: &[&str]) -> TwinResult<Output>
Worktreeを追加(オプションを直接渡す)
Sourcepub fn execute_git_command_raw(&mut self, args: &[&str]) -> TwinResult<Output>
pub fn execute_git_command_raw(&mut self, args: &[&str]) -> TwinResult<Output>
Gitコマンドを実行し、エラーメッセージをそのまま表示
Sourcepub fn remove_worktree(&mut self, path: &Path, force: bool) -> TwinResult<()>
pub fn remove_worktree(&mut self, path: &Path, force: bool) -> TwinResult<()>
Worktreeを削除
Sourcepub fn list_worktrees(&mut self) -> TwinResult<Vec<WorktreeInfo>>
pub fn list_worktrees(&mut self) -> TwinResult<Vec<WorktreeInfo>>
Worktreeの一覧を取得
Sourcepub fn get_worktree_info(&mut self, path: &Path) -> TwinResult<WorktreeInfo>
pub fn get_worktree_info(&mut self, path: &Path) -> TwinResult<WorktreeInfo>
特定のWorktreeの情報を取得
Sourcepub fn prune_worktrees(&mut self, dry_run: bool) -> TwinResult<Vec<PathBuf>>
pub fn prune_worktrees(&mut self, dry_run: bool) -> TwinResult<Vec<PathBuf>>
プルーニング可能なWorktreeをクリーンアップ
Sourcepub fn create_branch(
&mut self,
branch_name: &str,
start_point: Option<&str>,
) -> TwinResult<()>
pub fn create_branch( &mut self, branch_name: &str, start_point: Option<&str>, ) -> TwinResult<()>
ブランチを作成
Sourcepub fn delete_branch(
&mut self,
branch_name: &str,
force: bool,
) -> TwinResult<()>
pub fn delete_branch( &mut self, branch_name: &str, force: bool, ) -> TwinResult<()>
ブランチを削除
Sourcepub fn list_branches(&mut self, remote: bool) -> TwinResult<Vec<BranchInfo>>
pub fn list_branches(&mut self, remote: bool) -> TwinResult<Vec<BranchInfo>>
ブランチの一覧を取得
Sourcepub fn branch_exists(&mut self, branch_name: &str) -> TwinResult<bool>
pub fn branch_exists(&mut self, branch_name: &str) -> TwinResult<bool>
ブランチが存在するか確認
Sourcepub fn generate_unique_branch_name(
&mut self,
base_name: &str,
max_attempts: usize,
) -> TwinResult<String>
pub fn generate_unique_branch_name( &mut self, base_name: &str, max_attempts: usize, ) -> TwinResult<String>
ユニークなブランチ名を生成(既存のブランチと重複しないように)
Sourcepub fn get_command_history(&self) -> &[String]
pub fn get_command_history(&self) -> &[String]
コマンド実行履歴を取得
Sourcepub fn clear_command_history(&mut self)
pub fn clear_command_history(&mut self)
コマンド実行履歴をクリア
Sourcepub fn get_repo_path(&self) -> &Path
pub fn get_repo_path(&self) -> &Path
リポジトリのルートパスを取得
Sourcepub fn get_current_branch(&mut self) -> TwinResult<String>
pub fn get_current_branch(&mut self) -> TwinResult<String>
現在のブランチ名を取得
Sourcepub fn generate_cd_command(&self, path: &Path) -> String
pub fn generate_cd_command(&self, path: &Path) -> String
cdコマンド文字列を生成
Sourcepub fn generate_shell_helper(&self, shell_type: ShellType) -> String
pub fn generate_shell_helper(&self, shell_type: ShellType) -> String
シェル関数用のヘルパースクリプトを生成
Sourcepub fn generate_aliases(&self, shell_type: ShellType) -> String
pub fn generate_aliases(&self, shell_type: ShellType) -> String
エイリアス設定を生成
Auto Trait Implementations§
impl Freeze for GitManager
impl RefUnwindSafe for GitManager
impl Send for GitManager
impl !Sync for GitManager
impl Unpin for GitManager
impl UnwindSafe for GitManager
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