@@ -1112,6 +1112,7 @@ int SvnRevision::checkParentNotEmpty(apr_pool_t *pool, const char *key, QString
1112
1112
1113
1113
apr_hash_t *entries;
1114
1114
SVN_ERR (svn_fs_dir_entries (&entries, fs_root, parentKey.toStdString ().c_str (), pool));
1115
+ // directory is not empty
1115
1116
if (apr_hash_count (entries)!=0 ) {
1116
1117
return EXIT_FAILURE;
1117
1118
}
@@ -1122,6 +1123,19 @@ int SvnRevision::checkParentNotEmpty(apr_pool_t *pool, const char *key, QString
1122
1123
index = cleanPath.lastIndexOf (slash);
1123
1124
QString parentPath = cleanPath.left (index);
1124
1125
1126
+ // if svn-ignore should have added a .gitignore file, do not overwrite it with an empty one
1127
+ // if svn:ignore could not be determined, stay safe and do not overwrite the .gitignore file
1128
+ // even if then an empty directory might be missing
1129
+ QString svnignore;
1130
+ if (CommandLineParser::instance ()->contains (" svn-ignore" )) {
1131
+ if (fetchIgnoreProps (&svnignore, pool, parentKey.toStdString ().c_str (), fs_root) != EXIT_SUCCESS) {
1132
+ qWarning () << " Error fetching svn-properties (" << parentKey << " )" ;
1133
+ return EXIT_FAILURE;
1134
+ } else if (!svnignore.isNull ()) {
1135
+ return EXIT_FAILURE;
1136
+ }
1137
+ }
1138
+
1125
1139
// Add gitignore-File
1126
1140
QString gitIgnorePath = parentPath + " /.gitignore" ;
1127
1141
QIODevice *io = txn->addFile (gitIgnorePath, 33188 , 0 );
0 commit comments