Skip to content

Commit

Permalink
Hookup explain command (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jun 14, 2022
1 parent 12e6277 commit 1049b00
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gitoxide-core/src/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub mod tree;

pub mod commit;

pub mod revision;

pub mod verify;

pub mod odb;
Expand Down
11 changes: 11 additions & 0 deletions gitoxide-core/src/repository/revision/explain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use git_repository as git;
use std::ffi::OsString;

pub fn explain(
_repo: git::Repository,
_spec: OsString,
mut _out: impl std::io::Write,
mut _err: impl std::io::Write,
) -> anyhow::Result<()> {
Ok(())
}
2 changes: 2 additions & 0 deletions gitoxide-core/src/repository/revision/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod explain;
pub use explain::explain;
11 changes: 10 additions & 1 deletion src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,16 @@ pub fn main() -> Result<()> {
let repository = git::ThreadSafeRepository::discover(repository)?;
match cmd {
repo::Subcommands::Revision { cmd } => match cmd {
repo::revision::Subcommands::Explain { spec: _ } => todo!("describe spec"),
repo::revision::Subcommands::Explain { spec } => prepare_and_run(
"repository-commit-describe",
verbose,
progress,
progress_keep_open,
None,
move |_progress, out, err| {
core::repository::revision::explain(repository.into(), spec, out, err)
},
),
},
repo::Subcommands::Commit { cmd } => match cmd {
repo::commit::Subcommands::Describe {
Expand Down

0 comments on commit 1049b00

Please sign in to comment.