Skip to content
Snippets Groups Projects
Commit aed53a70 authored by Orgad Shaneh's avatar Orgad Shaneh
Browse files

Git: Place conflicted files last in submit editor


Change-Id: Ie4c7423d85f3f568d04d6c86e8b8123c73dab5fb
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a570e732
No related merge requests found
...@@ -108,6 +108,15 @@ static FileStates stateFor(const QChar &c) ...@@ -108,6 +108,15 @@ static FileStates stateFor(const QChar &c)
} }
} }
bool operator<(const CommitData::StateFilePair &a, const CommitData::StateFilePair &b)
{
if ((a.first & UnmergedFile) && !(b.first & UnmergedFile))
return false;
if ((b.first & UnmergedFile) && !(a.first & UnmergedFile))
return true;
return a.second < b.second;
}
bool CommitData::checkLine(const QString &stateInfo, const QString &file) bool CommitData::checkLine(const QString &stateInfo, const QString &file)
{ {
QTC_ASSERT(stateInfo.count() == 2, return false); QTC_ASSERT(stateInfo.count() == 2, return false);
...@@ -147,6 +156,7 @@ bool CommitData::checkLine(const QString &stateInfo, const QString &file) ...@@ -147,6 +156,7 @@ bool CommitData::checkLine(const QString &stateInfo, const QString &file)
files.append(qMakePair(yState, newFile)); files.append(qMakePair(yState, newFile));
} }
} }
qSort(files);
return true; return true;
} }
......
...@@ -109,6 +109,8 @@ private: ...@@ -109,6 +109,8 @@ private:
bool checkLine(const QString &stateInfo, const QString &file); bool checkLine(const QString &stateInfo, const QString &file);
}; };
bool operator<(const CommitData::StateFilePair &a, const CommitData::StateFilePair &b);
} // namespace Internal } // namespace Internal
} // namespace Git } // namespace Git
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment