merge ff 未测试

This commit is contained in:
HouXiaoxuan
2023-12-23 15:43:05 +08:00
parent 41a17634b7
commit 04b82f1aa6
3 changed files with 84 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
use clap::{ArgGroup, Parser, Subcommand};
use mit::commands::{
add::add, branch::branch, commit::commit, init::init, log::log, remove::remove, restore::restore, status::status,
switch::switch,
add::add, branch::branch, commit::commit, init::init, log::log, merge::merge, remove::remove, restore::restore,
status::status, switch::switch,
};
/// Rust实现的简易版本的Git用于学习Rust语言
@@ -117,6 +117,12 @@ enum Command {
#[clap(long, short = 'S', action)]
staged: bool,
},
/// merge
Merge {
/// 要合并的分支
#[clap(required = true)]
branch: String,
},
}
pub fn handle_command() {
let cli = Cli::parse();
@@ -162,5 +168,8 @@ pub fn handle_command() {
}
restore(path, source.unwrap(), worktree, staged);
}
Command::Merge { branch } => {
merge(branch);
}
}
}