Fixes: add timeout value to git plugin

RevBy:    tba
Details:  - as on windows some git commands take much longer it happens fairly often, that git timeouts.
          - added a timeout value to the option to let the user choose maximum timeout value (minimum is 10 seconds, maximum 5 minutes)
This commit is contained in:
lowinu
2009-02-13 12:52:01 +01:00
parent ae7864f9c0
commit b6c15d1ba9
7 changed files with 48 additions and 22 deletions

View File

@@ -207,20 +207,20 @@ void GitClient::diff(const QString &workingDirectory,
QStringList arguments;
arguments << QLatin1String("diff") << diffArgs;
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
command->addJob(arguments);
command->addJob(arguments, m_settings.timeout);
} else {
// Files diff.
if (!unstagedFileNames.empty()) {
QStringList arguments;
arguments << QLatin1String("diff") << diffArgs << QLatin1String("--") << unstagedFileNames;
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
command->addJob(arguments);
command->addJob(arguments, m_settings.timeout);
}
if (!stagedFileNames.empty()) {
QStringList arguments;
arguments << QLatin1String("diff") << QLatin1String("--cached") << diffArgs << QLatin1String("--") << stagedFileNames;
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
command->addJob(arguments);
command->addJob(arguments, m_settings.timeout);
}
}
command->execute();
@@ -503,7 +503,7 @@ void GitClient::executeGit(const QString &workingDirectory,
{
m_plugin->outputWindow()->append(formatCommand(QLatin1String(Constants::GIT_BINARY), arguments));
GitCommand *command = createCommand(workingDirectory, editor, outputToWindow);
command->addJob(arguments);
command->addJob(arguments, m_settings.timeout);
command->execute();
}