Commit 07e589ef authored by Friedemann Kleint's avatar Friedemann Kleint

Fixed b390e56d

Do not check for existence of the binary, breaks on Windows
due to .exe (and potentially paths). Use waitForStarted().
On this occasion, kill on timeout in case of password prompts.
parent d472ec9a
......@@ -104,10 +104,6 @@ void GitCommand::execute()
if (m_jobs.empty())
return;
if(!QFileInfo(m_binaryPath).exists()){
emit errorText(QLatin1String("Error: Git not found.")+m_binaryPath);
return;
}
// For some reason QtConcurrent::run() only works on this
QFuture<void> task = QtConcurrent::run(this, &GitCommand::run);
const QString taskName = QLatin1String("Git ") + m_jobs.front().arguments.at(0);
......@@ -137,8 +133,15 @@ void GitCommand::run()
qDebug() << "GitCommand::run" << j << '/' << count << m_jobs.at(j).arguments;
process.start(m_binaryPath, m_jobs.at(j).arguments);
if(!process.waitForStarted()) {
ok = false;
error += QString::fromLatin1("Error: \"%1\" could not be started: %2").arg(m_binaryPath, process.errorString());
break;
}
process.closeWriteChannel();
if (!process.waitForFinished(m_jobs.at(j).timeout * 1000)) {
process.terminate();
ok = false;
error += QLatin1String("Error: Git timed out");
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment