From ebac0993e896d18e0809fbb1167edf99b2677ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Alvarez?= Date: Thu, 23 Dec 2010 17:28:52 -0300 Subject: 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. --- src/repository.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.1