diff --git a/cli/src/commands/git/mod.rs b/cli/src/commands/git/mod.rs index ea45f9b00..53fb21bd6 100644 --- a/cli/src/commands/git/mod.rs +++ b/cli/src/commands/git/mod.rs @@ -55,6 +55,23 @@ pub enum GitCommand { Submodule(SubmoduleCommand), } +pub fn cmd_git( + ui: &mut Ui, + command: &CommandHelper, + subcommand: &GitCommand, +) -> Result<(), CommandError> { + match subcommand { + GitCommand::Clone(args) => cmd_git_clone(ui, command, args), + GitCommand::Export(args) => cmd_git_export(ui, command, args), + GitCommand::Fetch(args) => cmd_git_fetch(ui, command, args), + GitCommand::Import(args) => cmd_git_import(ui, command, args), + GitCommand::Init(args) => cmd_git_init(ui, command, args), + GitCommand::Push(args) => cmd_git_push(ui, command, args), + GitCommand::Remote(args) => cmd_git_remote(ui, command, args), + GitCommand::Submodule(args) => cmd_git_submodule(ui, command, args), + } +} + fn map_git_error(err: git2::Error) -> CommandError { if err.class() == git2::ErrorClass::Ssh { let hint = @@ -95,20 +112,3 @@ fn get_single_remote(git_repo: &git2::Repository) -> Result, Comm _ => None, }) } - -pub fn cmd_git( - ui: &mut Ui, - command: &CommandHelper, - subcommand: &GitCommand, -) -> Result<(), CommandError> { - match subcommand { - GitCommand::Clone(args) => cmd_git_clone(ui, command, args), - GitCommand::Export(args) => cmd_git_export(ui, command, args), - GitCommand::Fetch(args) => cmd_git_fetch(ui, command, args), - GitCommand::Import(args) => cmd_git_import(ui, command, args), - GitCommand::Init(args) => cmd_git_init(ui, command, args), - GitCommand::Push(args) => cmd_git_push(ui, command, args), - GitCommand::Remote(args) => cmd_git_remote(ui, command, args), - GitCommand::Submodule(args) => cmd_git_submodule(ui, command, args), - } -}