Commit 3a3dbb37 authored by Petar Perisin's avatar Petar Perisin
Browse files

Git: Fixed bug with branches missing from a list



Change-Id: Id4fa9f6c4f874c9b1ac5112efceaf0c22ed84d00
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent fb3d65a8
......@@ -2777,6 +2777,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
branches << tr("<Detached HEAD>");
QString headSha;
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
bool headFound = false;
foreach (const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
if (line.endsWith(QLatin1String("\tHEAD"))) {
QTC_CHECK(headSha.isNull());
......@@ -2786,7 +2787,6 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
const QString pattern = QLatin1String("\trefs/heads/");
const int pos = line.lastIndexOf(pattern);
bool headFound = false;
if (pos != -1) {
const QString branchName = line.mid(pos + pattern.count());
if (!headFound && line.startsWith(headSha)) {
......
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