Skip to content

Commit 7abc0a3

Browse files
committed
refactor (#450)
1 parent d95029e commit 7abc0a3

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

Diff for: gitoxide-core/src/repository/credential.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ pub fn function(_repo: git::Repository, action: git::credentials::program::main:
55
// TODO: use repo for configuration
66
use git::credentials::program::main::Action::*;
77
git::credentials::program::main(
8-
Some(
9-
match action {
10-
Get => "get",
11-
Store => "store",
12-
Erase => "erase",
13-
}
14-
.into(),
15-
),
8+
Some(action.as_str().into()),
169
std::io::stdin(),
1710
std::io::stdout(),
1811
|action, context| {

Diff for: src/plumbing/main.rs

+6-15
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,12 @@ pub fn main() -> Result<()> {
102102
})?;
103103

104104
match cmd {
105-
Subcommands::Credential(cmd) => prepare_and_run(
106-
"credential",
107-
verbose,
108-
progress,
109-
progress_keep_open,
110-
None,
111-
move |_progress, _out, _err| {
112-
core::repository::credential(
113-
repository(Mode::Strict)?,
114-
match cmd {
115-
credential::Subcommands::Fill => git::credentials::program::main::Action::Get,
116-
credential::Subcommands::Approve => git::credentials::program::main::Action::Store,
117-
credential::Subcommands::Reject => git::credentials::program::main::Action::Erase,
118-
},
119-
)
105+
Subcommands::Credential(cmd) => core::repository::credential(
106+
repository(Mode::Strict)?,
107+
match cmd {
108+
credential::Subcommands::Fill => git::credentials::program::main::Action::Get,
109+
credential::Subcommands::Approve => git::credentials::program::main::Action::Store,
110+
credential::Subcommands::Reject => git::credentials::program::main::Action::Erase,
120111
},
121112
),
122113
#[cfg_attr(feature = "small", allow(unused_variables))]

0 commit comments

Comments
 (0)