Git: Do not run 'git --version' synchronously at startup

We can easily delay this, and if git acts up for some reason, we don't
have to block startup.

Task-number: QTCREATORBUG-27765
Change-Id: I25aa6f8d04d1fd4b9d87f8ccf7ffd591f7bbe519
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2022-06-29 10:21:12 +02:00
parent 70fb66f9ee
commit f4c60fdf58
4 changed files with 62 additions and 48 deletions

View File

@@ -145,7 +145,7 @@ public:
static GitSettings &settings();
Utils::FilePath vcsBinary() const override;
unsigned gitVersion(QString *errorMessage = nullptr) const;
QFuture<unsigned> gitVersion() const;
VcsBase::VcsCommand *vcsExecAbortable(const Utils::FilePath &workingDirectory,
const QStringList &arguments,
@@ -387,9 +387,6 @@ private:
const Utils::FilePath &workingDirectory,
std::function<GitBaseDiffEditorController *(Core::IDocument *)> factory) const;
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
unsigned synchronousGitVersion(QString *errorMessage = nullptr) const;
QString readOneLine(const Utils::FilePath &workingDirectory, const QStringList &arguments) const;
enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed };