Commit 808afcfb authored by Petar Perisin's avatar Petar Perisin
Browse files

Git - made Clean List support submodules



Change-Id: I106420e8492d64451eee3648800ce57a4de2bfb9
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 4ca80b15
......@@ -2029,7 +2029,6 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString &
// Retrieve list of files to be cleaned
bool GitClient::cleanList(const QString &workingDirectory, const QString &flag, QStringList *files, QString *errorMessage)
{
files->clear();
QStringList args;
args << QLatin1String("clean") << QLatin1String("--dry-run") << flag;
QByteArray outputText;
......@@ -2052,6 +2051,15 @@ bool GitClient::synchronousCleanList(const QString &workingDirectory, QStringLis
{
bool res = cleanList(workingDirectory, QLatin1String("-df"), files, errorMessage);
res &= cleanList(workingDirectory, QLatin1String("-dXf"), ignoredFiles, errorMessage);
SubmoduleDataMap submodules = submoduleList(workingDirectory);
foreach (const SubmoduleData &submodule, submodules) {
if (submodule.ignore != QLatin1String("all")
&& submodule.ignore != QLatin1String("dirty")) {
res &= synchronousCleanList(workingDirectory + QLatin1Char('/') + submodule.dir,
files, ignoredFiles, errorMessage);
}
}
return res;
}
......
Supports Markdown
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