| 39 | } |
| 40 | |
| 41 | int Git::git( const std::string& args, const std::string& projectDir, std::string& buf ) const { |
| 42 | Clock clock; |
| 43 | buf.clear(); |
| 44 | Process p; |
| 45 | if ( !p.create( mGitPath, args, |
| 46 | Process::CombinedStdoutStderr | Process::Options::NoWindow | |
| 47 | Process::Options::EnableAsync | Process::Options::InheritEnvironment, |
| 48 | { { "LC_ALL", "en_US.UTF-8" } }, |
| 49 | projectDir.empty() ? mProjectPath : projectDir ) ) { |
| 50 | return EXIT_FAILURE; |
| 51 | } |
| 52 | p.readAllStdOut( buf ); |
| 53 | int retCode = 0; |
| 54 | p.join( &retCode ); |
| 55 | if ( !mSilent || retCode != EXIT_SUCCESS ) { |
| 56 | Log::instance()->writef( retCode != EXIT_SUCCESS ? LogLevel::Info : LogLevel::Debug, |
| 57 | "GitPlugin cmd in %s (%d): %s %s", |
| 58 | clock.getElapsedTime().toString(), retCode, mGitPath, args ); |
| 59 | } |
| 60 | return retCode; |
| 61 | } |
| 62 | |
| 63 | void Git::gitSubmodules( const std::string& args, const std::string& projectDir, |
| 64 | std::string& buf ) { |
nothing calls this directly
no test coverage detected