mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Add index tracking to status
This commit is contained in:
parent
6c26f3d0e4
commit
1e4ab6cd75
@ -100,9 +100,9 @@ impl GitRepository for LibGitRepository {
|
|||||||
fn read_status(status: git2::Status) -> Option<GitFileStatus> {
|
fn read_status(status: git2::Status) -> Option<GitFileStatus> {
|
||||||
if status.contains(git2::Status::CONFLICTED) {
|
if status.contains(git2::Status::CONFLICTED) {
|
||||||
Some(GitFileStatus::Conflict)
|
Some(GitFileStatus::Conflict)
|
||||||
} else if status.intersects(git2::Status::WT_MODIFIED | git2::Status::WT_RENAMED) {
|
} else if status.intersects(git2::Status::WT_MODIFIED | git2::Status::WT_RENAMED | git2::Status::INDEX_MODIFIED | git2::Status::INDEX_RENAMED) {
|
||||||
Some(GitFileStatus::Modified)
|
Some(GitFileStatus::Modified)
|
||||||
} else if status.intersects(git2::Status::WT_NEW) {
|
} else if status.intersects(git2::Status::WT_NEW | git2::Status::INDEX_NEW) {
|
||||||
Some(GitFileStatus::Added)
|
Some(GitFileStatus::Added)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
Loading…
Reference in New Issue
Block a user