Skip to content

GitPlugin::remove: delete files, not trash them

Igor Kushnir requested to merge igorkushnir/kdevelop:git-rm-del-not-trash into master

This is the only usage of KIO::trash() in KDevelop's code base. I don't think it is appropriate here. The trashing occurs only if the file list contains a file not under version control or contains only directories, no files. Otherwise, git rm -r --force is used, which simply deletes files. So using KIO::trash() introduces a gratuitous inconsistency.

I noticed this issue by examining my Trash. It contained lots of directories named "dir" and "emptydir", lots of files named "bar" and "testfile" removed from /tmp/kdevGit_testdir/. These files and directories are put to Trash each time test_kdevgit runs.

4b50220a introduced the first call to KIO::trash(). Later commits that touched this code simply followed suit or ported to a new API version.

Merge request reports