Handle bad init in libgit2

This commit is contained in:
Seth Hillbrand 2025-07-30 16:20:11 -07:00
parent da19b87cb1
commit 3d4afcc051

View File

@ -326,7 +326,19 @@ bool PGM_SINGLE_TOP::OnPgmInit()
#endif
// Initialize the git library before trying to initialize individual programs
git_libgit2_init();
int gitInit = git_libgit2_init();
if( gitInit < 0 )
{
const git_error* err = git_error_last();
wxString msg = wxS( "Failed to initialize git library" );
if( err && err->message )
msg += wxS( ": " ) + wxString::FromUTF8( err->message );
wxLogError( msg );
return false;
}
// Not all KiCad applications use the python stuff. skip python init
// for these apps.