Add rebase option for worktrees

This commit is contained in:
2021-12-29 19:02:42 +01:00
parent 7a2fa7ae3f
commit ef8a57c60e
5 changed files with 445 additions and 1 deletions

View File

@@ -91,6 +91,8 @@ pub enum WorktreeAction {
Fetch(WorktreeFetchArgs),
#[clap(about = "Fetch refs from remotes and update local branches")]
Pull(WorktreePullArgs),
#[clap(about = "Rebase worktree onto default branch")]
Rebase(WorktreeRebaseArgs),
}
#[derive(Parser)]
@@ -137,6 +139,14 @@ pub struct WorktreePullArgs {
pub rebase: bool,
}
#[derive(Parser)]
pub struct WorktreeRebaseArgs {
#[clap(long = "--pull", about = "Perform a pull before rebasing")]
pub pull: bool,
#[clap(long = "--rebase", about = "Perform a rebase when doing a pull")]
pub rebase: bool,
}
pub fn parse() -> Opts {
Opts::parse()
}