Skip to content

Commit 2d1e74d

Browse files
committed
refactor: update GitStatus to use untracked over new
1 parent 4158ab3 commit 2d1e74d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/fs/feature/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ fn reorient(path: &Path) -> PathBuf {
368368
fn working_tree_status(status: git2::Status) -> f::GitStatus {
369369
#[rustfmt::skip]
370370
return match status {
371-
s if s.contains(git2::Status::WT_NEW) => f::GitStatus::New,
371+
s if s.contains(git2::Status::WT_NEW) => f::GitStatus::Untracked,
372372
s if s.contains(git2::Status::WT_MODIFIED) => f::GitStatus::Modified,
373373
s if s.contains(git2::Status::WT_DELETED) => f::GitStatus::Deleted,
374374
s if s.contains(git2::Status::WT_RENAMED) => f::GitStatus::Renamed,
@@ -384,7 +384,7 @@ fn working_tree_status(status: git2::Status) -> f::GitStatus {
384384
fn index_status(status: git2::Status) -> f::GitStatus {
385385
#[rustfmt::skip]
386386
return match status {
387-
s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::New,
387+
s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::Untracked,
388388
s if s.contains(git2::Status::INDEX_MODIFIED) => f::GitStatus::Modified,
389389
s if s.contains(git2::Status::INDEX_DELETED) => f::GitStatus::Deleted,
390390
s if s.contains(git2::Status::INDEX_RENAMED) => f::GitStatus::Renamed,

src/fs/fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub enum GitStatus {
223223

224224
/// This file didn’t exist for the last commit, and is not specified in
225225
/// the ignored files list.
226-
New,
226+
Untracked,
227227

228228
/// A file that’s been modified since the last commit.
229229
Modified,

src/output/render/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl f::GitStatus {
2323
#[rustfmt::skip]
2424
return match self {
2525
Self::NotModified => colours.not_modified().paint("-"),
26-
Self::New => colours.untracked().paint("N"),
26+
Self::Untracked => colours.untracked().paint("N"),
2727
Self::Modified => colours.modified().paint("M"),
2828
Self::Deleted => colours.deleted().paint("D"),
2929
Self::Renamed => colours.renamed().paint("R"),
@@ -148,7 +148,7 @@ pub mod test {
148148
#[test]
149149
fn git_new_changed() {
150150
let stati = f::Git {
151-
staged: f::GitStatus::New,
151+
staged: f::GitStatus::Untracked,
152152
unstaged: f::GitStatus::Modified,
153153
};
154154

0 commit comments

Comments
 (0)