Git: Make branch lookup more robust

It might fail because a particular branch points to an invalid commit.
We don't want that to prevent display of all other branches.

Change-Id: I8fe427735351fc458c99396dc1f9d77bc948468e
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-01-06 12:04:36 +02:00
committed by Orgad Shaneh
parent 0917a067af
commit 5abce3ab9f
2 changed files with 18 additions and 24 deletions

View File

@@ -307,10 +307,8 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
branchArgs << QLatin1String(GitClient::noColorOption)
<< QLatin1String("-v") << QLatin1String("-a");
QString output;
if (!m_client->synchronousBranchCmd(workingDirectory, branchArgs, &output, errorMessage)) {
if (!m_client->synchronousBranchCmd(workingDirectory, branchArgs, &output, errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage);
return false;
}
beginResetModel();
@@ -472,10 +470,8 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
QStringList args;
args << QLatin1String("-a") << QLatin1String("--contains") << sha(idx);
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
return false;
}
QStringList lines = output.split(QLatin1Char('\n'), QString::SkipEmptyParts);
foreach (const QString &l, lines) {