From b3e2c580f2fcbc06ece01be7927bcd6588e92793 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 27 Sep 2018 21:12:52 +0300 Subject: [PATCH] Git: Fix return value of BranchModel::refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return false if for-each-ref fails, and true if not applicable (this is not an error). Fixes: QTCREATORBUG-21189 Change-Id: I895046f8c15c30abeddaa8b4231fb4bd46c343ef Reviewed-by: André Hartmann --- src/plugins/git/branchmodel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 4c78bf51087..047b3ebf99d 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -341,15 +341,17 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage clear(); if (workingDirectory.isEmpty()) { endResetModel(); - return false; + return true; } m_currentSha = m_client->synchronousTopRevision(workingDirectory); const QStringList args = {"--format=%(objectname)\t%(refname)\t%(upstream:short)\t" "%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)"}; QString output; - if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage)) - VcsOutputWindow::appendError(*errorMessage); + if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage)) { + endResetModel(); + return false; + } m_workingDirectory = workingDirectory; const QStringList lines = output.split('\n');