forked from qt-creator/qt-creator
Git - use appropriate working directory in ChangeSelectionDialog
In case Working Directory is changed in dialog, use new one for command. Change-Id: Iea2e71d3695fff49a6375d19d723f4d62a092c2f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -776,20 +776,23 @@ void GitPlugin::startRebase()
|
||||
void GitPlugin::startChangeRelatedAction()
|
||||
{
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
const QString workingDirectory = state.topLevel();
|
||||
if (workingDirectory.isEmpty())
|
||||
if (!state.hasTopLevel())
|
||||
return;
|
||||
|
||||
QPointer<ChangeSelectionDialog> dialog = new ChangeSelectionDialog
|
||||
(workingDirectory, Core::ICore::mainWindow());
|
||||
(state.topLevel(), Core::ICore::mainWindow());
|
||||
|
||||
int result = dialog->exec();
|
||||
|
||||
if (dialog.isNull() || (result == QDialog::Rejected) || dialog->change().isEmpty())
|
||||
if (dialog.isNull() || result == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
const QString workingDirectory = dialog->workingDirectory();
|
||||
const QString change = dialog->change();
|
||||
|
||||
if (workingDirectory.isEmpty() || change.isEmpty())
|
||||
return;
|
||||
|
||||
if (dialog->command() == Show) {
|
||||
m_gitClient->show(workingDirectory, change);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user