Skip to content

Commit 0ed65da

Browse files
committed
move 'odb' up one level (#331)
1 parent 38a8350 commit 0ed65da

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

src/plumbing/main.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use git_repository::bstr::io::BufReadExt;
1313
use gitoxide_core as core;
1414
use gitoxide_core::pack::verify;
1515

16-
use crate::plumbing::options::{commit, revision, tree};
16+
use crate::plumbing::options::{commit, odb, revision, tree};
1717
use crate::{
1818
plumbing::options::{free, repo, Args, Subcommands},
1919
shared::pretty::prepare_and_run,
@@ -581,6 +581,24 @@ pub fn main() -> Result<()> {
581581
},
582582
),
583583
},
584+
Subcommands::Odb { cmd } => match cmd {
585+
odb::Subcommands::Entries => prepare_and_run(
586+
"repository-odb-entries",
587+
verbose,
588+
progress,
589+
progress_keep_open,
590+
None,
591+
move |_progress, out, _err| core::repository::odb::entries(repository()?.into(), format, out),
592+
),
593+
odb::Subcommands::Info => prepare_and_run(
594+
"repository-odb-info",
595+
verbose,
596+
progress,
597+
progress_keep_open,
598+
None,
599+
move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
600+
),
601+
},
584602
Subcommands::Repository(repo::Platform { cmd }) => match cmd {
585603
repo::Subcommands::Exclude { cmd } => match cmd {
586604
repo::exclude::Subcommands::Query {
@@ -629,24 +647,6 @@ pub fn main() -> Result<()> {
629647
},
630648
),
631649
},
632-
repo::Subcommands::Odb { cmd } => match cmd {
633-
repo::odb::Subcommands::Entries => prepare_and_run(
634-
"repository-odb-entries",
635-
verbose,
636-
progress,
637-
progress_keep_open,
638-
None,
639-
move |_progress, out, _err| core::repository::odb::entries(repository()?.into(), format, out),
640-
),
641-
repo::odb::Subcommands::Info => prepare_and_run(
642-
"repository-odb-info",
643-
verbose,
644-
progress,
645-
progress_keep_open,
646-
None,
647-
move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
648-
),
649-
},
650650
},
651651
}?;
652652
Ok(())

src/plumbing/options.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ pub struct Args {
5151

5252
#[derive(Debug, clap::Subcommand)]
5353
pub enum Subcommands {
54+
/// Interact with the object database.
55+
Odb {
56+
#[clap(subcommand)]
57+
cmd: odb::Subcommands,
58+
},
5459
/// Interact with tree objects.
5560
Tree {
5661
#[clap(subcommand)]
@@ -78,6 +83,16 @@ pub enum Subcommands {
7883
Free(free::Subcommands),
7984
}
8085

86+
pub mod odb {
87+
#[derive(Debug, clap::Subcommand)]
88+
pub enum Subcommands {
89+
/// Print all object names.
90+
Entries,
91+
/// Provide general information about the object database.
92+
Info,
93+
}
94+
}
95+
8196
pub mod tree {
8297
#[derive(Debug, clap::Subcommand)]
8398
pub enum Subcommands {
@@ -564,11 +579,6 @@ pub mod repo {
564579
#[derive(Debug, clap::Subcommand)]
565580
#[clap(visible_alias = "repo")]
566581
pub enum Subcommands {
567-
/// Interact with the object database.
568-
Odb {
569-
#[clap(subcommand)]
570-
cmd: odb::Subcommands,
571-
},
572582
/// Interact with the mailmap.
573583
Mailmap {
574584
#[clap(subcommand)]
@@ -614,14 +624,4 @@ pub mod repo {
614624
Entries,
615625
}
616626
}
617-
618-
pub mod odb {
619-
#[derive(Debug, clap::Subcommand)]
620-
pub enum Subcommands {
621-
/// Print all object names.
622-
Entries,
623-
/// Provide general information about the object database.
624-
Info,
625-
}
626-
}
627627
}

0 commit comments

Comments
 (0)