[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdevplatform] plugins/git: git: support removing empty folders
From: Niko Sams <niko.sams () gmail ! com>
Date: 2013-12-29 10:50:14
Message-ID: E1VxDwk-00051r-I4 () scm ! kde ! org
[Download RAW message or body]
Git commit cca689d079ec8a54198451bd920131f081937a59 by Niko Sams.
Committed on 23/12/2013 at 11:15.
Pushed by nsams into branch 'master'.
git: support removing empty folders
git doesn't allow that, similar to removing empty folders
M +10 -0 plugins/git/gitplugin.cpp
http://commits.kde.org/kdevplatform/cca689d079ec8a54198451bd920131f081937a59
diff --git a/plugins/git/gitplugin.cpp b/plugins/git/gitplugin.cpp
index 66bde12..4b5e54b 100644
--- a/plugins/git/gitplugin.cpp
+++ b/plugins/git/gitplugin.cpp
@@ -1271,6 +1271,16 @@ VcsJob* GitPlugin::copy(const KUrl& localLocationSrc, const \
KUrl& localLocationD VcsJob* GitPlugin::move(const KUrl& source, const KUrl& \
destination) {
QDir dir = urlDir(source);
+
+ QFileInfo fileInfo(source.toLocalFile());
+ if (fileInfo.isDir()) {
+ if (isEmptyDirStructure(QDir(source.toLocalFile()))) {
+ //move empty folder, git doesn't do that
+ kDebug() << "empty folder" << source;
+ return new StandardJob(this, KIO::move(source, destination), \
KDevelop::OutputJob::Silent); + }
+ }
+
QStringList otherStr = getLsFiles(dir, QStringList() << "--others" << "--" << \
source.toLocalFile(), KDevelop::OutputJob::Silent); if(otherStr.isEmpty()) {
DVcsJob* job = new DVcsJob(dir, this, KDevelop::OutputJob::Verbose);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic