Commit 4b50220a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

When removing a file or directory, check if it has git versioned stuff. In...

When removing a file or directory, check if it has git versioned stuff. In that case ask Git to remove it, otherwise trash it.
parent 197fd410
......@@ -379,11 +379,17 @@ VcsJob* GitPlugin::remove(const KUrl::List& files)
{
if (files.isEmpty())
return errorsFound(i18n("No files to remove"));
QDir dir = dotGitDirectory(files.front());
DVcsJob* job = new DVcsJob(urlDir(files), this);
*job << "git" << "rm" << "-r";
*job << "--" << files;
return job;
QStringList otherStr = getLsFiles(dir, QStringList() << "--others" << "--" << files.front().toLocalFile(), KDevelop::OutputJob::Silent);
if(otherStr.isEmpty()) {
DVcsJob* job = new GitJob(dir, this);
*job << "git" << "rm" << "-r";
*job << "--" << files;
return job;
} else {
return new StandardJob(this, KIO::trash(files), KDevelop::OutputJob::Silent);
}
}
VcsJob* GitPlugin::log(const KUrl& localLocation,
......
Markdown is supported
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