Git: Switch order of GitClient and GerritPlugin construction

The GerritPlugin constructor calls GerritParameters::fromSettings()
which then calls calls detectApp() if there is no curl (or no ssh/GIT_SSH).
On Windows this ends up calling GitClient::instance()->gitBinDirectory()
which crashes as the GitClent instance does not exist at this time.

Work around by switching the construction order.

Change-Id: I0b1172d6b7ec96502a51684578b78042a42a95ca
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-07-25 15:19:25 +02:00
parent 3c58c87585
commit 5e5b90a9a1

View File

@@ -421,9 +421,10 @@ public:
QVector<ParameterAction *> m_projectActions;
QVector<QAction *> m_repositoryActions;
ParameterAction *m_applyCurrentFilePatchAction = nullptr;
Gerrit::Internal::GerritPlugin m_gerritPlugin;
GitClient m_gitClient;
Gerrit::Internal::GerritPlugin m_gerritPlugin;
QPointer<StashDialog> m_stashDialog;
BranchViewFactory m_branchViewFactory;
QPointer<RemoteDialog> m_remoteDialog;