aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolás Alvarez <nicolas.alvarez@gmail.com>2010-12-23 17:28:52 -0300
committerNicolás Alvarez <nicolas.alvarez@gmail.com>2010-12-23 17:28:52 -0300
commitebac0993e896d18e0809fbb1167edf99b2677ac3 (patch)
tree33edb89b6bf1634ede66baa5a4bcfa9e17e7cdfa
parent409d8bc4cbaade82672f251c45178c3cfed4619d (diff)
downloadsvn2git-ebac0993e896d18e0809fbb1167edf99b2677ac3.tar
svn2git-ebac0993e896d18e0809fbb1167edf99b2677ac3.tar.gz
svn2git-ebac0993e896d18e0809fbb1167edf99b2677ac3.tar.bz2
svn2git-ebac0993e896d18e0809fbb1167edf99b2677ac3.tar.xz
svn2git-ebac0993e896d18e0809fbb1167edf99b2677ac3.zip
Fix serious performance regression.
In Repository::commit, don't call startFastImport() if we have nothing to write to the fastImport stream. startFastImport() may start new git-fast-import processes if they were previously killed, so it may be extremely slow to call it frequently if it's not necessary.
-rw-r--r--src/repository.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index b362bdf..7baf995 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -374,6 +374,9 @@ int Repository::resetBranch(const QString &branch, int revnum, int mark, const Q
void Repository::commit()
{
+ if (deletedBranches.isEmpty() && resetBranches.isEmpty()) {
+ return;
+ }
startFastImport();
fastImport.write(deletedBranches);
fastImport.write(resetBranches);