diff options
author | Friedemann Kleint <[email protected]> | 2010-02-26 17:43:37 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2010-02-26 17:43:37 +0100 |
commit | 214679d65ba4ebd2d2be0b177f5eeac7df6d32aa (patch) | |
tree | 3250efa96ff614dff3c2e4c6522a4f03abc85b4d /src/plugins/git/gitclient.cpp | |
parent | 1e09e55bc3fd466ba03decfe956e64d1c819ee99 (diff) |
Git: Improve Timeouts.
- Observe timeout setting when running synchronous commands.
- Increase Default on Windows
- Stop process with terminate first (signal).
Task-number: QTCREATORBUG-777
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r-- | src/plugins/git/gitclient.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 5026295e151..c7a150a2ef4 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -236,20 +236,20 @@ void GitClient::diff(const QString &workingDirectory, QStringList arguments(commonDiffArgs); arguments << diffArgs; VCSBase::VCSBaseOutputWindow::instance()->appendCommand(formatCommand(binary, arguments)); - command->addJob(arguments, m_settings.timeout); + command->addJob(arguments, m_settings.timeoutSeconds); } else { // Files diff. if (!unstagedFileNames.empty()) { QStringList arguments(commonDiffArgs); arguments << QLatin1String("--") << unstagedFileNames; VCSBase::VCSBaseOutputWindow::instance()->appendCommand(formatCommand(binary, arguments)); - command->addJob(arguments, m_settings.timeout); + command->addJob(arguments, m_settings.timeoutSeconds); } if (!stagedFileNames.empty()) { QStringList arguments(commonDiffArgs); arguments << QLatin1String("--cached") << diffArgs << QLatin1String("--") << stagedFileNames; VCSBase::VCSBaseOutputWindow::instance()->appendCommand(formatCommand(binary, arguments)); - command->addJob(arguments, m_settings.timeout); + command->addJob(arguments, m_settings.timeoutSeconds); } } command->execute(); @@ -985,7 +985,7 @@ GitCommand *GitClient::executeGit(const QString &workingDirectory, { VCSBase::VCSBaseOutputWindow::instance()->appendCommand(formatCommand(QLatin1String(Constants::GIT_BINARY), arguments)); GitCommand *command = createCommand(workingDirectory, editor, outputToWindow, editorLineNumber); - command->addJob(arguments, m_settings.timeout); + command->addJob(arguments, m_settings.timeoutSeconds); command->setTerminationReportMode(tm); command->execute(); return command; @@ -1042,10 +1042,10 @@ bool GitClient::synchronousGit(const QString &workingDirectory, return false; } - if (!process.waitForFinished()) { + if (!process.waitForFinished(m_settings.timeoutSeconds * 1000)) { if (errorText) - *errorText = "Error: Git timed out."; - process.kill(); + *errorText = GitCommand::msgTimeout(m_settings.timeoutSeconds).toLocal8Bit(); + GitCommand::stopProcess(process); return false; } |