forked from qt-creator/qt-creator
Git: Fixed bug with branches missing from a list
Change-Id: Id4fa9f6c4f874c9b1ac5112efceaf0c22ed84d00 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -2777,6 +2777,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
branches << tr("<Detached HEAD>");
|
branches << tr("<Detached HEAD>");
|
||||||
QString headSha;
|
QString headSha;
|
||||||
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
||||||
|
bool headFound = false;
|
||||||
foreach (const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
foreach (const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
||||||
if (line.endsWith(QLatin1String("\tHEAD"))) {
|
if (line.endsWith(QLatin1String("\tHEAD"))) {
|
||||||
QTC_CHECK(headSha.isNull());
|
QTC_CHECK(headSha.isNull());
|
||||||
@@ -2786,7 +2787,6 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
|
|
||||||
const QString pattern = QLatin1String("\trefs/heads/");
|
const QString pattern = QLatin1String("\trefs/heads/");
|
||||||
const int pos = line.lastIndexOf(pattern);
|
const int pos = line.lastIndexOf(pattern);
|
||||||
bool headFound = false;
|
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
const QString branchName = line.mid(pos + pattern.count());
|
const QString branchName = line.mid(pos + pattern.count());
|
||||||
if (!headFound && line.startsWith(headSha)) {
|
if (!headFound && line.startsWith(headSha)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user