Git: Fix indentation in ensureStash()

Change-Id: I5243fce895ae21a2b07cb9e0d98a60d69f848b10
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-01-22 20:21:54 +02:00
committed by Orgad Shaneh
parent daef1fbb88
commit 246f8e9aaf

View File

@@ -1278,22 +1278,22 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri
QString errorMessage; QString errorMessage;
switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules), 0, &errorMessage)) { switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules), 0, &errorMessage)) {
case StatusChanged: { case StatusChanged: {
message = creatorStashMessage(messageKeyword); message = creatorStashMessage(messageKeyword);
do { do {
if ((flags & StashPromptDescription)) { if ((flags & StashPromptDescription)) {
if (!inputText(Core::ICore::mainWindow(), if (!inputText(Core::ICore::mainWindow(),
tr("Stash Description"), tr("Description:"), &message)) tr("Stash Description"), tr("Description:"), &message))
break;
}
if (!executeSynchronousStash(workingDirectory, message))
break; break;
if ((flags & StashImmediateRestore) }
&& !synchronousStashRestore(workingDirectory, QLatin1String("stash@{0}"))) if (!executeSynchronousStash(workingDirectory, message))
break; break;
success = true; if ((flags & StashImmediateRestore)
} while (false); && !synchronousStashRestore(workingDirectory, QLatin1String("stash@{0}")))
} break;
success = true;
} while (false);
break; break;
}
case StatusUnchanged: case StatusUnchanged:
if (unchanged) if (unchanged)
*unchanged = true; *unchanged = true;
@@ -1583,11 +1583,11 @@ GitClient::StashResult GitClient::ensureStash(const QString &workingDirectory, c
QString statusOutput; QString statusOutput;
switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules), switch (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules),
&statusOutput, errorMessage)) { &statusOutput, errorMessage)) {
case StatusChanged: case StatusChanged:
break; break;
case StatusUnchanged: case StatusUnchanged:
return StashUnchanged; return StashUnchanged;
case StatusFailed: case StatusFailed:
return StashFailed; return StashFailed;
} }
@@ -1595,19 +1595,19 @@ GitClient::StashResult GitClient::ensureStash(const QString &workingDirectory, c
tr("Would you like to stash your changes?"), tr("Would you like to stash your changes?"),
statusOutput, QMessageBox::Yes, QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel); statusOutput, QMessageBox::Yes, QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel);
switch (answer) { switch (answer) {
case QMessageBox::Cancel: case QMessageBox::Cancel:
return StashCanceled; return StashCanceled;
case QMessageBox::Yes: { case QMessageBox::Yes: {
const QString stashMessage = creatorStashMessage(keyword); const QString stashMessage = creatorStashMessage(keyword);
if (!executeSynchronousStash(workingDirectory, stashMessage, errorMessage)) if (!executeSynchronousStash(workingDirectory, stashMessage, errorMessage))
return StashFailed; return StashFailed;
if (message) if (message)
*message = stashMessage; *message = stashMessage;
break; break;
} }
case QMessageBox::No: // At your own risk, so. case QMessageBox::No: // At your own risk, so.
return NotStashed; return NotStashed;
} }
return Stashed; return Stashed;
} }