Skip to content

Commit

Permalink
refactor (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 5, 2022
1 parent d95029e commit 7abc0a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
9 changes: 1 addition & 8 deletions gitoxide-core/src/repository/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ pub fn function(_repo: git::Repository, action: git::credentials::program::main:
// TODO: use repo for configuration
use git::credentials::program::main::Action::*;
git::credentials::program::main(
Some(
match action {
Get => "get",
Store => "store",
Erase => "erase",
}
.into(),
),
Some(action.as_str().into()),
std::io::stdin(),
std::io::stdout(),
|action, context| {
Expand Down
21 changes: 6 additions & 15 deletions src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,12 @@ pub fn main() -> Result<()> {
})?;

match cmd {
Subcommands::Credential(cmd) => prepare_and_run(
"credential",
verbose,
progress,
progress_keep_open,
None,
move |_progress, _out, _err| {
core::repository::credential(
repository(Mode::Strict)?,
match cmd {
credential::Subcommands::Fill => git::credentials::program::main::Action::Get,
credential::Subcommands::Approve => git::credentials::program::main::Action::Store,
credential::Subcommands::Reject => git::credentials::program::main::Action::Erase,
},
)
Subcommands::Credential(cmd) => core::repository::credential(
repository(Mode::Strict)?,
match cmd {
credential::Subcommands::Fill => git::credentials::program::main::Action::Get,
credential::Subcommands::Approve => git::credentials::program::main::Action::Store,
credential::Subcommands::Reject => git::credentials::program::main::Action::Erase,
},
),
#[cfg_attr(feature = "small", allow(unused_variables))]
Expand Down

0 comments on commit 7abc0a3

Please sign in to comment.