Skip to content

Commit cdf07de

Browse files
committed
change index/worktree diff to a visitor based API
1 parent 179ea39 commit cdf07de

File tree

21 files changed

+556
-388
lines changed

21 files changed

+556
-388
lines changed

gix-worktree/src/diff.rs

Lines changed: 0 additions & 306 deletions
This file was deleted.

gix-worktree/src/index/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::fs;
77

88
pub mod checkout;
99
pub(crate) mod entry;
10+
pub mod status;
1011

1112
/// Note that interruption still produce an `Ok(…)` value, so the caller should look at `should_interrupt` to communicate the outcome.
1213
/// `dir` is the directory into which to checkout the `index`.

gix-worktree/src/index/status.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//!
2+
3+
mod worktree;
4+
5+
mod index;
6+
7+
///
8+
pub mod visit;
9+
10+
///
11+
pub mod recorder;
12+
13+
///
14+
pub struct IndexStatus<'index> {
15+
index: &'index gix_index::State,
16+
}
17+
18+
impl<'index> From<&'index gix_index::File> for IndexStatus<'index> {
19+
fn from(file: &'index gix_index::File) -> Self {
20+
Self { index: file }
21+
}
22+
}
23+
24+
impl<'index> From<&'index gix_index::State> for IndexStatus<'index> {
25+
fn from(index: &'index gix_index::State) -> Self {
26+
Self { index }
27+
}
28+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: index to index diff
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
///
2+
pub mod index;
3+
///
4+
pub mod worktree;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: index diff

0 commit comments

Comments
 (0)