Skip to content

Commit 6f980d0

Browse files
committed
Scaffold gix diff tree
1 parent 795962b commit 6f980d0

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use gix::bstr::BString;
2+
3+
pub fn tree(
4+
_repo: gix::Repository,
5+
_out: &mut dyn std::io::Write,
6+
_treeish1: BString,
7+
_treeish2: BString,
8+
) -> anyhow::Result<()> {
9+
Ok(())
10+
}

gitoxide-core/src/repository/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub use credential::function as credential;
2828
pub mod attributes;
2929
#[cfg(feature = "clean")]
3030
pub mod clean;
31+
pub mod diff;
3132
pub mod dirty;
3233
#[cfg(feature = "clean")]
3334
pub use clean::function::clean;

src/plumbing/main.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ pub fn main() -> Result<()> {
189189
core::repository::merge_base(repository(Mode::Lenient)?, first, others, out, format)
190190
},
191191
),
192+
Subcommands::Diff(crate::plumbing::options::diff::Platform { cmd }) => match cmd {
193+
crate::plumbing::options::diff::SubCommands::Tree { treeish1, treeish2 } => prepare_and_run(
194+
"diff-tree",
195+
trace,
196+
verbose,
197+
progress,
198+
progress_keep_open,
199+
None,
200+
move |_progress, out, _err| {
201+
core::repository::diff::tree(repository(Mode::Lenient)?, out, treeish1, treeish2)
202+
},
203+
),
204+
},
192205
Subcommands::Worktree(crate::plumbing::options::worktree::Platform { cmd }) => match cmd {
193206
crate::plumbing::options::worktree::SubCommands::List => prepare_and_run(
194207
"worktree-list",

src/plumbing/options/mod.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub enum Subcommands {
145145
Corpus(corpus::Platform),
146146
MergeBase(merge_base::Command),
147147
Merge(merge::Platform),
148+
Diff(diff::Platform),
148149
Worktree(worktree::Platform),
149150
/// Subcommands that need no git repository to run.
150151
#[clap(subcommand)]
@@ -384,6 +385,30 @@ pub mod merge {
384385
}
385386
}
386387

388+
pub mod diff {
389+
use gix::bstr::BString;
390+
391+
#[derive(Debug, clap::Parser)]
392+
#[command(about = "TODO")]
393+
pub struct Platform {
394+
#[clap(subcommand)]
395+
pub cmd: SubCommands,
396+
}
397+
398+
#[derive(Debug, clap::Subcommand)]
399+
pub enum SubCommands {
400+
/// TODO
401+
Tree {
402+
/// TODO
403+
#[clap( value_parser = crate::shared::AsBString)]
404+
treeish1: BString,
405+
/// TODO
406+
#[clap( value_parser = crate::shared::AsBString)]
407+
treeish2: BString,
408+
},
409+
}
410+
}
411+
387412
pub mod config {
388413
use gix::bstr::BString;
389414

0 commit comments

Comments
 (0)