From bf4709961337864eb0ef163bb77fc4e3ef5d166d Mon Sep 17 00:00:00 2001 From: Niko Sams Date: Fri, 24 Sep 2010 21:15:32 +0200 Subject: add assertions to write() methods to make sure nothing is written into a closed fast-import --- src/repository.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/repository.cpp b/src/repository.cpp index 4bfba6e..7f85e34 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -52,33 +52,40 @@ public: }; qint64 write(const char *data) { + Q_ASSERT(state() == QProcess::Running); if(logging) { log.write(data); } return QProcess::write(data); } qint64 write(const char *data, qint64 length) { + Q_ASSERT(state() == QProcess::Running); if(logging) { log.write(data); } return QProcess::write(data, length); } qint64 write(const QByteArray &data) { + Q_ASSERT(state() == QProcess::Running); if(logging) { log.write(data); } return QProcess::write(data); } qint64 writeNoLog(const char *data) { + Q_ASSERT(state() == QProcess::Running); return QProcess::write(data); } qint64 writeNoLog(const char *data, qint64 length) { + Q_ASSERT(state() == QProcess::Running); return QProcess::write(data, length); } qint64 writeNoLog(const QByteArray &data) { + Q_ASSERT(state() == QProcess::Running); return QProcess::write(data); } bool putChar( char c) { + Q_ASSERT(state() == QProcess::Running); if(logging) { log.putChar(c); } @@ -714,6 +721,7 @@ void FastImportRepository::startFastImport() } else { fastImport.start("/bin/cat", QStringList()); } + fastImport.waitForStarted(-1); reloadBranches(); } -- cgit v1.2.1