Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1a71e40

Browse files
committed
If svn-ignore should have added a .gitignore file, do not overwrite it with an empty one
1 parent 34c2d55 commit 1a71e40

File tree

2 files changed

+435
-0
lines changed

2 files changed

+435
-0
lines changed

‎src/svn.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@ int SvnRevision::checkParentNotEmpty(apr_pool_t *pool, const char *key, QString
11121112

11131113
apr_hash_t *entries;
11141114
SVN_ERR(svn_fs_dir_entries(&entries, fs_root, parentKey.toStdString().c_str(), pool));
1115+
// directory is not empty
11151116
if (apr_hash_count(entries)!=0) {
11161117
return EXIT_FAILURE;
11171118
}
@@ -1122,6 +1123,19 @@ int SvnRevision::checkParentNotEmpty(apr_pool_t *pool, const char *key, QString
11221123
index = cleanPath.lastIndexOf(slash);
11231124
QString parentPath = cleanPath.left(index);
11241125

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+
11251139
// Add gitignore-File
11261140
QString gitIgnorePath = parentPath + "/.gitignore";
11271141
QIODevice *io = txn->addFile(gitIgnorePath, 33188, 0);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /