More Utils::toSet/toList

... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-07-03 18:34:30 +02:00
parent 599b03179e
commit 6a58666f44
49 changed files with 138 additions and 105 deletions

View File

@@ -2805,9 +2805,9 @@ GitClient::RevertResult GitClient::revertI(QStringList files,
QStringList stagedFiles = allStagedFiles;
QStringList unstagedFiles = allUnstagedFiles;
if (!isDirectory) {
const QSet<QString> filesSet = files.toSet();
stagedFiles = allStagedFiles.toSet().intersect(filesSet).toList();
unstagedFiles = allUnstagedFiles.toSet().intersect(filesSet).toList();
const QSet<QString> filesSet = Utils::toSet(files);
stagedFiles = Utils::toList(Utils::toSet(allStagedFiles).intersect(filesSet));
unstagedFiles = Utils::toList(Utils::toSet(allUnstagedFiles).intersect(filesSet));
}
if ((!revertStaging || stagedFiles.empty()) && unstagedFiles.empty())
return RevertUnchanged;