Git: handle new-but-already-staged files

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19893
This commit is contained in:
Jon Evans
2025-02-08 17:03:42 -05:00
parent 172b77039f
commit f59c5a9a26
2 changed files with 31 additions and 4 deletions
+10 -1
View File
@@ -99,18 +99,27 @@ DIALOG_GIT_COMMIT::DIALOG_GIT_COMMIT( wxWindow* parent, git_repository* repo,
m_listCtrl->SetItem( i, 1, _( "New" ) );
m_listCtrl->SetItemImage(
i, static_cast<int>( KIGIT_COMMON::GIT_STATUS::GIT_STATUS_ADDED ) );
if( status & ( GIT_STATUS_INDEX_NEW ) )
m_listCtrl->CheckItem( i, true );
}
else if( status & ( GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED ) )
{
m_listCtrl->SetItem( i, 1, _( "Modified" ) );
m_listCtrl->SetItemImage(
i, static_cast<int>( KIGIT_COMMON::GIT_STATUS::GIT_STATUS_MODIFIED ) );
if( status & ( GIT_STATUS_INDEX_MODIFIED ) )
m_listCtrl->CheckItem( i, true );
}
else if( status & ( GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_DELETED ) )
{
m_listCtrl->SetItem( i, 1, _( "Deleted" ) );
m_listCtrl->SetItemImage(
i, static_cast<int>( KIGIT_COMMON::GIT_STATUS::GIT_STATUS_DELETED ) );
if( status & ( GIT_STATUS_INDEX_DELETED ) )
m_listCtrl->CheckItem( i, true );
}
else
{
@@ -220,4 +229,4 @@ std::vector<wxString> DIALOG_GIT_COMMIT::GetSelectedFiles() const
}
return selectedFiles;
}
}