Struct GitManager

Source
pub struct GitManager { /* private fields */ }
Expand description

Git操作を管理する構造体

Implementations§

Source§

impl GitManager

Source

pub fn new(repo_path: &Path) -> TwinResult<Self>

新しいGitManagerインスタンスを作成

Source

pub fn set_dry_run(&mut self, dry_run: bool)

ドライランモードを設定

Source

pub fn add_worktree( &mut self, path: &Path, branch: Option<&str>, create_branch: bool, ) -> TwinResult<WorktreeInfo>

Worktreeを追加

Source

pub fn add_worktree_with_options(&mut self, args: &[&str]) -> TwinResult<Output>

Worktreeを追加(オプションを直接渡す)

Source

pub fn execute_git_command_raw(&mut self, args: &[&str]) -> TwinResult<Output>

Gitコマンドを実行し、エラーメッセージをそのまま表示

Source

pub fn remove_worktree(&mut self, path: &Path, force: bool) -> TwinResult<()>

Worktreeを削除

Source

pub fn list_worktrees(&mut self) -> TwinResult<Vec<WorktreeInfo>>

Worktreeの一覧を取得

Source

pub fn get_worktree_info(&mut self, path: &Path) -> TwinResult<WorktreeInfo>

特定のWorktreeの情報を取得

Source

pub fn prune_worktrees(&mut self, dry_run: bool) -> TwinResult<Vec<PathBuf>>

プルーニング可能なWorktreeをクリーンアップ

Source

pub fn create_branch( &mut self, branch_name: &str, start_point: Option<&str>, ) -> TwinResult<()>

ブランチを作成

Source

pub fn delete_branch( &mut self, branch_name: &str, force: bool, ) -> TwinResult<()>

ブランチを削除

Source

pub fn list_branches(&mut self, remote: bool) -> TwinResult<Vec<BranchInfo>>

ブランチの一覧を取得

Source

pub fn branch_exists(&mut self, branch_name: &str) -> TwinResult<bool>

ブランチが存在するか確認

Source

pub fn generate_unique_branch_name( &mut self, base_name: &str, max_attempts: usize, ) -> TwinResult<String>

ユニークなブランチ名を生成(既存のブランチと重複しないように)

Source

pub fn get_command_history(&self) -> &[String]

コマンド実行履歴を取得

Source

pub fn clear_command_history(&mut self)

コマンド実行履歴をクリア

Source

pub fn get_repo_path(&self) -> &Path

リポジトリのルートパスを取得

Source

pub fn get_current_branch(&mut self) -> TwinResult<String>

現在のブランチ名を取得

Source

pub fn generate_cd_command(&self, path: &Path) -> String

cdコマンド文字列を生成

Source

pub fn generate_shell_helper(&self, shell_type: ShellType) -> String

シェル関数用のヘルパースクリプトを生成

Source

pub fn generate_aliases(&self, shell_type: ShellType) -> String

エイリアス設定を生成

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,