diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-29 11:34:06 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-29 11:34:06 +0200 |
commit | 07e589ef8e13bbd93ca84a20afae9631eeabcfd4 (patch) | |
tree | 1f97b941e509b1a3ad643fa3b7d5bd5804c41efa /src/plugins/git/gitcommand.cpp | |
parent | d472ec9a4cee4da67696ad46f7b386fa84532eb8 (diff) | |
download | qt-creator-07e589ef8e13bbd93ca84a20afae9631eeabcfd4.tar.gz |
Fixed b390e56d676cd0a838e4b59b51b431535f760bb0
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.
Diffstat (limited to 'src/plugins/git/gitcommand.cpp')
-rw-r--r-- | src/plugins/git/gitcommand.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/git/gitcommand.cpp b/src/plugins/git/gitcommand.cpp index e3fcd8571b..77b945802e 100644 --- a/src/plugins/git/gitcommand.cpp +++ b/src/plugins/git/gitcommand.cpp @@ -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; |