forked from qt-creator/qt-creator
Git: Fix adding existing files in nested directories
Amends 48c56416f5
.
Fixes: QTCREATORBUG-27644
Change-Id: I4ef58c017e4fcf8fa48905f7e0b649433b3cac0f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
693db6eef6
commit
d2160e8b4f
@@ -916,11 +916,12 @@ FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
|
||||
const CommandResult result = vcsSynchronousExec(it.key(), args, RunFlags::NoOutput);
|
||||
if (result.result() != ProcessResult::FinishedWithSuccess)
|
||||
return filePaths;
|
||||
const QStringList managedFilePaths
|
||||
= transform(result.cleanedStdOut().split('\0', Qt::SkipEmptyParts),
|
||||
[&wd](const QString &fp) { return wd.absoluteFilePath(fp); });
|
||||
const QStringList filtered = Utils::filtered(it.value(), [&managedFilePaths, &wd](const QString &fp) {
|
||||
return !managedFilePaths.contains(wd.absoluteFilePath(fp));
|
||||
const auto toAbs = [&wd](const QString &fp) { return wd.absoluteFilePath(fp); };
|
||||
const QStringList managedFilePaths =
|
||||
Utils::transform(result.cleanedStdOut().split('\0', Qt::SkipEmptyParts), toAbs);
|
||||
const QStringList absPaths = Utils::transform(it.value(), toAbs);
|
||||
const QStringList filtered = Utils::filtered(absPaths, [&managedFilePaths](const QString &fp) {
|
||||
return !managedFilePaths.contains(fp);
|
||||
});
|
||||
res += FileUtils::toFilePathList(filtered);
|
||||
}
|
||||
|
Reference in New Issue
Block a user