Skip to content

Commit 5e1038a

Browse files
Vampiretnyblom
authored andcommitted
Make sure the fast import process is started before writing to it, otherwise Qt 5 will warn about the not running process
1 parent 51dab7f commit 5e1038a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/repository.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,16 @@ void FastImportRepository::reloadBranches()
496496
if (!branchRef.startsWith("refs/"))
497497
branchRef.prepend("refs/heads/");
498498

499+
startFastImport();
499500
fastImport.write("reset " + branchRef +
500501
"\nfrom :" + QByteArray::number(br.marks.last()) + "\n\n"
501502
"progress Branch " + branchRef + " reloaded\n");
502503
}
503504

504505
if (reset_notes &&
505506
CommandLineParser::instance()->contains("add-metadata-notes")) {
507+
508+
startFastImport();
506509
fastImport.write("reset refs/notes/commits\nfrom :" +
507510
QByteArray::number(maxMark + 1) +
508511
"\n");
@@ -903,8 +906,9 @@ QIODevice *FastImportRepository::Transaction::addFile(const QString &path, int m
903906
modifiedFiles.append(repository->prefix + path.toUtf8());
904907
modifiedFiles.append("\n");
905908

909+
// it is returned for being written to, so start the process in any case
910+
repository->startFastImport();
906911
if (!CommandLineParser::instance()->contains("dry-run")) {
907-
repository->startFastImport();
908912
repository->fastImport.writeNoLog("blob\nmark :");
909913
repository->fastImport.writeNoLog(QByteArray::number(mark));
910914
repository->fastImport.writeNoLog("\ndata ");
@@ -941,6 +945,7 @@ void FastImportRepository::Transaction::commitNote(const QByteArray &noteText, b
941945
s.append("N inline " + commitRef + "\n");
942946
s.append("data " + QString::number(text.length()) + "\n");
943947
s.append(text + "\n");
948+
repository->startFastImport();
944949
repository->fastImport.write(s);
945950

946951
if (commit.isNull()) {

0 commit comments

Comments
 (0)