aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Sams <niko.sams@gmail.com>2010-09-24 21:15:32 +0200
committerNiko Sams <niko.sams@gmail.com>2010-09-24 21:56:16 +0200
commitbf4709961337864eb0ef163bb77fc4e3ef5d166d (patch)
treea8f77725d264ce06ed5b2e334e1cc07d2341e8ed
parentf0ac33760478522817bd4b6bb15a4c89c9ac6674 (diff)
downloadsvn2git-bf4709961337864eb0ef163bb77fc4e3ef5d166d.tar
svn2git-bf4709961337864eb0ef163bb77fc4e3ef5d166d.tar.gz
svn2git-bf4709961337864eb0ef163bb77fc4e3ef5d166d.tar.bz2
svn2git-bf4709961337864eb0ef163bb77fc4e3ef5d166d.tar.xz
svn2git-bf4709961337864eb0ef163bb77fc4e3ef5d166d.zip
add assertions to write() methods to make sure nothing is written into a closed fast-import
-rw-r--r--src/repository.cpp8
1 files changed, 8 insertions, 0 deletions
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();
}