feat: remove file from index

This commit is contained in:
Antonin Ruan
2026-03-12 19:18:33 +01:00
parent 3027a99b5f
commit c118829c11
5 changed files with 97 additions and 23 deletions
+6 -6
View File
@@ -1,21 +1,21 @@
use crate::subcommands::{
add::AddSubcommand, hash_object::HashObjectSubcommand, init::InitSubcommand,
remove::RemoveSubcommand, test::TestSubcommand,
add::AddSubcommand, hash_object::HashObjectSubcommand, init::InitSubcommand, rm::RmSubcommand,
test::TestSubcommand,
};
use anyhow::Result;
mod add;
mod hash_object;
mod init;
mod remove;
mod rm;
mod test;
#[derive(clap::Parser, Debug)]
pub enum SubcommandType {
/// Add file(s) to index
Add(AddSubcommand),
/// Remove file from the working and the index
Remove(RemoveSubcommand),
/// Remove file(s) from the index
Rm(RmSubcommand),
/// Init a Git repository
Init(InitSubcommand),
HashObject(HashObjectSubcommand),
@@ -30,7 +30,7 @@ impl Subcommand for SubcommandType {
fn run(&self) -> Result<String> {
match self {
Self::Add(cmd) => cmd.run(),
Self::Remove(cmd) => cmd.run(),
Self::Rm(cmd) => cmd.run(),
Self::Init(cmd) => cmd.run(),
Self::HashObject(cmd) => cmd.run(),
Self::Test(cmd) => cmd.run(),