mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-01-14 01:11:13 +00:00
git-feature: display if a file is updated but unmerged (conflicted)
This commit is contained in:
parent
78ba0b8973
commit
45eade9a59
@ -282,6 +282,7 @@ fn working_tree_status(status: git2::Status) -> f::GitStatus {
|
||||
s if s.contains(git2::Status::WT_RENAMED) => f::GitStatus::Renamed,
|
||||
s if s.contains(git2::Status::WT_TYPECHANGE) => f::GitStatus::TypeChange,
|
||||
s if s.contains(git2::Status::IGNORED) => f::GitStatus::Ignored,
|
||||
s if s.contains(git2::Status::CONFLICTED) => f::GitStatus::Conflicted,
|
||||
_ => f::GitStatus::NotModified,
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +200,9 @@ pub enum GitStatus {
|
||||
|
||||
/// A file that’s ignored (that matches a line in .gitignore)
|
||||
Ignored,
|
||||
|
||||
/// A file that's updated but unmerged.
|
||||
Conflicted,
|
||||
}
|
||||
|
||||
/// A file’s complete Git status. It’s possible to make changes to a file, add
|
||||
|
@ -27,6 +27,7 @@ impl f::GitStatus {
|
||||
f::GitStatus::Renamed => colours.renamed().paint("R"),
|
||||
f::GitStatus::TypeChange => colours.type_change().paint("T"),
|
||||
f::GitStatus::Ignored => colours.ignored().paint("I"),
|
||||
f::GitStatus::Conflicted => colours.conflicted().paint("U"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,6 +41,7 @@ pub trait Colours {
|
||||
fn renamed(&self) -> Style;
|
||||
fn type_change(&self) -> Style;
|
||||
fn ignored(&self) -> Style;
|
||||
fn conflicted(&self) -> Style;
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +65,7 @@ pub mod test {
|
||||
fn renamed(&self) -> Style { Fixed(94).normal() }
|
||||
fn type_change(&self) -> Style { Fixed(95).normal() }
|
||||
fn ignored(&self) -> Style { Fixed(96).normal() }
|
||||
fn conflicted(&self) -> Style { Fixed(93).normal() }
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +104,7 @@ pub struct Git {
|
||||
pub renamed: Style,
|
||||
pub typechange: Style,
|
||||
pub ignored: Style,
|
||||
pub conflicted: Style,
|
||||
}
|
||||
|
||||
impl Colours {
|
||||
@ -168,6 +169,7 @@ impl Colours {
|
||||
renamed: Yellow.normal(),
|
||||
typechange: Purple.normal(),
|
||||
ignored: Style::default().dimmed(),
|
||||
conflicted: Red.normal(),
|
||||
},
|
||||
|
||||
punctuation: Fixed(244).normal(),
|
||||
@ -394,6 +396,7 @@ impl render::GitColours for Colours {
|
||||
fn renamed(&self) -> Style { self.git.renamed }
|
||||
fn type_change(&self) -> Style { self.git.typechange }
|
||||
fn ignored(&self) -> Style { self.git.ignored }
|
||||
fn conflicted(&self) -> Style { self.git.conflicted }
|
||||
}
|
||||
|
||||
impl render::GroupColours for Colours {
|
||||
|
Loading…
Reference in New Issue
Block a user