Git plugin fixes

This commit is contained in:
Martín Lucas Golini
2024-01-22 23:54:34 -03:00
parent d8f97e7258
commit a11b6ef9c5
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -60,7 +60,9 @@ Git::Git( const std::string& projectDir, const std::string& gitPath ) : mGitPath
int Git::git( const std::string& args, const std::string& projectDir, std::string& buf ) const {
buf.clear();
Process p;
p.create( mGitPath, args, Process::CombinedStdoutStderr | Process::Options::NoWindow,
p.create( mGitPath, args,
Process::CombinedStdoutStderr | Process::Options::NoWindow |
Process::Options::InheritEnvironment,
{ { "LC_ALL", "en_US.UTF-8" } }, projectDir.empty() ? mProjectPath : projectDir );
p.readAllStdOut( buf );
int retCode;
+2 -2
View File
@@ -1275,8 +1275,9 @@ void GitPlugin::runAsync( std::function<Git::Result()> fn, bool _updateStatus,
if ( !mGit )
return;
mLoader->setVisible( true );
mThreadPool->run( [&] {
mThreadPool->run( [this, fn, _updateStatus, _updateBranches] {
auto res = fn();
getUISceneNode()->runOnMainThread( [this] { mLoader->setVisible( false ); } );
if ( res.fail() ) {
showMessage( LSPMessageType::Warning, res.result );
return;
@@ -1285,7 +1286,6 @@ void GitPlugin::runAsync( std::function<Git::Result()> fn, bool _updateStatus,
updateBranches();
if ( _updateStatus )
updateStatus( true );
getUISceneNode()->runOnMainThread( [this] { mLoader->setVisible( false ); } );
} );
}