Commit 246f8e9a authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Fix indentation in ensureStash()



Change-Id: I5243fce895ae21a2b07cb9e0d98a60d69f848b10
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent daef1fbb
......@@ -1278,22 +1278,22 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri
QString errorMessage;
switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules), 0, &errorMessage)) {
case StatusChanged: {
message = creatorStashMessage(messageKeyword);
do {
if ((flags & StashPromptDescription)) {
if (!inputText(Core::ICore::mainWindow(),
tr("Stash Description"), tr("Description:"), &message))
break;
}
if (!executeSynchronousStash(workingDirectory, message))
break;
if ((flags & StashImmediateRestore)
&& !synchronousStashRestore(workingDirectory, QLatin1String("stash@{0}")))
message = creatorStashMessage(messageKeyword);
do {
if ((flags & StashPromptDescription)) {
if (!inputText(Core::ICore::mainWindow(),
tr("Stash Description"), tr("Description:"), &message))
break;
success = true;
} while (false);
}
}
if (!executeSynchronousStash(workingDirectory, message))
break;
if ((flags & StashImmediateRestore)
&& !synchronousStashRestore(workingDirectory, QLatin1String("stash@{0}")))
break;
success = true;
} while (false);
break;
}
case StatusUnchanged:
if (unchanged)
*unchanged = true;
......@@ -1583,11 +1583,11 @@ GitClient::StashResult GitClient::ensureStash(const QString &workingDirectory, c
QString statusOutput;
switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules),
&statusOutput, errorMessage)) {
case StatusChanged:
case StatusChanged:
break;
case StatusUnchanged:
case StatusUnchanged:
return StashUnchanged;
case StatusFailed:
case StatusFailed:
return StashFailed;
}
......@@ -1595,19 +1595,19 @@ GitClient::StashResult GitClient::ensureStash(const QString &workingDirectory, c
tr("Would you like to stash your changes?"),
statusOutput, QMessageBox::Yes, QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel);
switch (answer) {
case QMessageBox::Cancel:
return StashCanceled;
case QMessageBox::Yes: {
const QString stashMessage = creatorStashMessage(keyword);
if (!executeSynchronousStash(workingDirectory, stashMessage, errorMessage))
return StashFailed;
if (message)
*message = stashMessage;
break;
}
case QMessageBox::No: // At your own risk, so.
return NotStashed;
}
case QMessageBox::Cancel:
return StashCanceled;
case QMessageBox::Yes: {
const QString stashMessage = creatorStashMessage(keyword);
if (!executeSynchronousStash(workingDirectory, stashMessage, errorMessage))
return StashFailed;
if (message)
*message = stashMessage;
break;
}
case QMessageBox::No: // At your own risk, so.
return NotStashed;
}
return Stashed;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment