From d3a65e0639db4f9f060f2ee6cbccc6339ae9d750 Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Mon, 24 Jun 2024 10:28:05 +1000 Subject: [PATCH] take care of the index too --- crates/mapdiffbot2/src/git_operations.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/mapdiffbot2/src/git_operations.rs b/crates/mapdiffbot2/src/git_operations.rs index 8aa50524..0c4ae4ee 100644 --- a/crates/mapdiffbot2/src/git_operations.rs +++ b/crates/mapdiffbot2/src/git_operations.rs @@ -233,11 +233,18 @@ fn commit_all_stragglers(repo: &Repository) -> Result<()> { .statuses(None)? .into_iter() .find(|item| { - item.status().is_wt_modified() - || item.status().is_wt_deleted() - || item.status().is_wt_new() - || item.status().is_wt_renamed() - || item.status().is_wt_typechange() + item.status().contains( + git2::Status::INDEX_NEW + | git2::Status::INDEX_MODIFIED + | git2::Status::INDEX_DELETED + | git2::Status::INDEX_RENAMED + | git2::Status::INDEX_TYPECHANGE + | git2::Status::WT_NEW + | git2::Status::WT_MODIFIED + | git2::Status::WT_DELETED + | git2::Status::WT_RENAMED + | git2::Status::WT_TYPECHANGE, + ) }) .map_or(false, |_| true); if dirty {