Skip to content

Commit a437abe

Browse files
committed
refactor (#331)
1 parent 8e5b796 commit a437abe

File tree

2 files changed

+18
-30
lines changed

2 files changed

+18
-30
lines changed

Diff for: src/plumbing/main.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ pub fn main() -> Result<()> {
503503
)
504504
},
505505
),
506-
Subcommands::Revision { cmd } => match cmd {
506+
Subcommands::Revision(cmd) => match cmd {
507507
revision::Subcommands::Explain { spec } => prepare_and_run(
508508
"repository-commit-describe",
509509
verbose,
@@ -513,7 +513,7 @@ pub fn main() -> Result<()> {
513513
move |_progress, out, _err| core::repository::revision::explain(repository()?.into(), spec, out),
514514
),
515515
},
516-
Subcommands::Commit { cmd } => match cmd {
516+
Subcommands::Commit(cmd) => match cmd {
517517
commit::Subcommands::Describe {
518518
annotated_tags,
519519
all_refs,
@@ -548,7 +548,7 @@ pub fn main() -> Result<()> {
548548
},
549549
),
550550
},
551-
Subcommands::Tree { cmd } => match cmd {
551+
Subcommands::Tree(cmd) => match cmd {
552552
tree::Subcommands::Entries {
553553
treeish,
554554
recursive,
@@ -581,7 +581,7 @@ pub fn main() -> Result<()> {
581581
},
582582
),
583583
},
584-
Subcommands::Odb { cmd } => match cmd {
584+
Subcommands::Odb(cmd) => match cmd {
585585
odb::Subcommands::Entries => prepare_and_run(
586586
"repository-odb-entries",
587587
verbose,
@@ -599,7 +599,7 @@ pub fn main() -> Result<()> {
599599
move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
600600
),
601601
},
602-
Subcommands::Mailmap { cmd } => match cmd {
602+
Subcommands::Mailmap(cmd) => match cmd {
603603
mailmap::Subcommands::Entries => prepare_and_run(
604604
"repository-mailmap-entries",
605605
verbose,
@@ -609,7 +609,7 @@ pub fn main() -> Result<()> {
609609
move |_progress, out, err| core::repository::mailmap::entries(repository()?.into(), format, out, err),
610610
),
611611
},
612-
Subcommands::Exclude { cmd } => match cmd {
612+
Subcommands::Exclude(cmd) => match cmd {
613613
exclude::Subcommands::Query {
614614
patterns,
615615
pathspecs,

Diff for: src/plumbing/options.rs

+12-24
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,28 @@ pub struct Args {
5252
#[derive(Debug, clap::Subcommand)]
5353
pub enum Subcommands {
5454
/// Interact with the object database.
55-
Odb {
56-
#[clap(subcommand)]
57-
cmd: odb::Subcommands,
58-
},
55+
#[clap(subcommand)]
56+
Odb(odb::Subcommands),
5957
/// Interact with tree objects.
60-
Tree {
61-
#[clap(subcommand)]
62-
cmd: tree::Subcommands,
63-
},
58+
#[clap(subcommand)]
59+
Tree(tree::Subcommands),
6460
/// Interact with commit objects.
65-
Commit {
66-
#[clap(subcommand)]
67-
cmd: commit::Subcommands,
68-
},
61+
#[clap(subcommand)]
62+
Commit(commit::Subcommands),
6963
/// Verify the integrity of the entire repository
7064
Verify {
7165
#[clap(flatten)]
7266
args: free::pack::VerifyOptions,
7367
},
7468
/// Query and obtain information about revisions.
75-
Revision {
76-
#[clap(subcommand)]
77-
cmd: revision::Subcommands,
78-
},
69+
#[clap(subcommand)]
70+
Revision(revision::Subcommands),
7971
/// Interact with the mailmap.
80-
Mailmap {
81-
#[clap(subcommand)]
82-
cmd: mailmap::Subcommands,
83-
},
72+
#[clap(subcommand)]
73+
Mailmap(mailmap::Subcommands),
8474
/// Interact with the exclude files like .gitignore.
85-
Exclude {
86-
#[clap(subcommand)]
87-
cmd: exclude::Subcommands,
88-
},
75+
#[clap(subcommand)]
76+
Exclude(exclude::Subcommands),
8977
/// Subcommands that need no git repository to run.
9078
#[clap(subcommand)]
9179
Free(free::Subcommands),

0 commit comments

Comments
 (0)