From 79308db48d41a760276d100bf062fee0913e37f7 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Wed, 18 Mar 2020 12:15:50 +0100 Subject: [PATCH] show renamed files correctly in index --- src/git_status.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/git_status.rs b/src/git_status.rs index 4ac95a43..dc86bc0d 100644 --- a/src/git_status.rs +++ b/src/git_status.rs @@ -67,12 +67,18 @@ impl StatusLists { for e in statuses.iter() { let status: Status = e.status(); - if status.is_ignored() { - continue; - } + // if status.is_ignored() { + // continue; + // } + + let path = if let Some(diff) = e.head_to_index() { + String::from(diff.new_file().path().unwrap().to_str().unwrap()) + } else { + e.path().unwrap().to_string() + }; res.push(StatusItem { - path: e.path().unwrap().to_string(), + path, status: Some(StatusItemType::from(status)), }); }