Skip to content

Commit e9ef797

Browse files
committed
feat: add Status iterator.
TBD
1 parent a3ab5bc commit e9ef797

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

gix/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ pub use gix_ref as refs;
133133
pub use gix_refspec as refspec;
134134
pub use gix_revwalk as revwalk;
135135
pub use gix_sec as sec;
136-
#[cfg(feature = "status")]
137-
pub use gix_status as status;
138136
pub use gix_tempfile as tempfile;
139137
pub use gix_trace as trace;
140138
pub use gix_traverse as traverse;
@@ -317,6 +315,10 @@ pub mod init;
317315
/// Not to be confused with 'status'.
318316
pub mod state;
319317

318+
///
319+
#[cfg(feature = "status")]
320+
pub mod status;
321+
320322
///
321323
pub mod shallow;
322324

gix/src/status.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use crate::Repository;
2+
pub use gix_status as plumbing;
3+
4+
/// A structure to hold options configuring the status request, which can then be turned into an iterator.
5+
#[derive(Clone)]
6+
pub struct Platform<'repo> {
7+
repo: &'repo Repository,
8+
}
9+
10+
/// Status
11+
impl Repository {
12+
/// Obtain a platform for configuring and traversing the git repository status.
13+
///
14+
// TODO: assure that the index-to-worktree changes are implemented in such a way that the index
15+
// contains entries with UPTODATE flags set for each entry that didn't change.
16+
// Only then the dirwalk can run and do the right thing, which is avoid using filesystem access
17+
// to learn about the file type.
18+
pub fn status(&self) -> Platform<'_> {
19+
Platform { repo: self }
20+
}
21+
}

0 commit comments

Comments
 (0)