Skip to content

Commit f00d5a5

Browse files
Vampiretnyblom
authored andcommitted
Do not output the generated .gitignore contents in dry-run mode or it ends up in the log
1 parent 5e1038a commit f00d5a5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/svn.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,15 @@ int SvnRevision::addGitIgnore(apr_pool_t *pool, const char *key, QString path,
10311031
QString gitIgnorePath = path + ".gitignore";
10321032
if (content) {
10331033
QIODevice *io = txn->addFile(gitIgnorePath, 33188, strlen(content));
1034-
io->write(content);
1035-
io->putChar('\n');
1034+
if (!CommandLineParser::instance()->contains("dry-run")) {
1035+
io->write(content);
1036+
io->putChar('\n');
1037+
}
10361038
} else {
10371039
QIODevice *io = txn->addFile(gitIgnorePath, 33188, 0);
1038-
io->putChar('\n');
1040+
if (!CommandLineParser::instance()->contains("dry-run")) {
1041+
io->putChar('\n');
1042+
}
10391043
}
10401044

10411045
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)