Skip to content

Commit

Permalink
Upgrade libgit2
Browse files Browse the repository at this point in the history
The ogham/git2-rs repository that exa uses in the Vagrant VM has also been updated. The only casualty was that some constants got namespaced.
  • Loading branch information
ogham committed Mar 11, 2018
1 parent ffefc5c commit f757300
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ lto = true
panic = "abort"

[dependencies.git2]
version = "0.6.4"
version = "0.7"
optional = true
default-features = false
24 changes: 12 additions & 12 deletions src/fs/feature/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,24 @@ fn reorient(path: &Path) -> PathBuf {
/// The character to display if the file has been modified, but not staged.
fn working_tree_status(status: git2::Status) -> f::GitStatus {
match status {
s if s.contains(git2::STATUS_WT_NEW) => f::GitStatus::New,
s if s.contains(git2::STATUS_WT_MODIFIED) => f::GitStatus::Modified,
s if s.contains(git2::STATUS_WT_DELETED) => f::GitStatus::Deleted,
s if s.contains(git2::STATUS_WT_RENAMED) => f::GitStatus::Renamed,
s if s.contains(git2::STATUS_WT_TYPECHANGE) => f::GitStatus::TypeChange,
_ => f::GitStatus::NotModified,
s if s.contains(git2::Status::WT_NEW) => f::GitStatus::New,
s if s.contains(git2::Status::WT_MODIFIED) => f::GitStatus::Modified,
s if s.contains(git2::Status::WT_DELETED) => f::GitStatus::Deleted,
s if s.contains(git2::Status::WT_RENAMED) => f::GitStatus::Renamed,
s if s.contains(git2::Status::WT_TYPECHANGE) => f::GitStatus::TypeChange,
_ => f::GitStatus::NotModified,
}
}

/// The character to display if the file has been modified and the change
/// has been staged.
fn index_status(status: git2::Status) -> f::GitStatus {
match status {
s if s.contains(git2::STATUS_INDEX_NEW) => f::GitStatus::New,
s if s.contains(git2::STATUS_INDEX_MODIFIED) => f::GitStatus::Modified,
s if s.contains(git2::STATUS_INDEX_DELETED) => f::GitStatus::Deleted,
s if s.contains(git2::STATUS_INDEX_RENAMED) => f::GitStatus::Renamed,
s if s.contains(git2::STATUS_INDEX_TYPECHANGE) => f::GitStatus::TypeChange,
_ => f::GitStatus::NotModified,
s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::New,
s if s.contains(git2::Status::INDEX_MODIFIED) => f::GitStatus::Modified,
s if s.contains(git2::Status::INDEX_DELETED) => f::GitStatus::Deleted,
s if s.contains(git2::Status::INDEX_RENAMED) => f::GitStatus::Renamed,
s if s.contains(git2::Status::INDEX_TYPECHANGE) => f::GitStatus::TypeChange,
_ => f::GitStatus::NotModified,
}
}

0 comments on commit f757300

Please sign in to comment.