From 6eb3af27464ffba83e3478b0a0c8b1f9ff190889 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 22 Aug 2015 16:31:31 +0200 Subject: fix(repo): use GitCmdObjectDB by default This should fix resource leaking issues once and for all. Related #304 --- doc/source/changes.rst | 3 +++ git/repo/base.py | 7 ++----- git/test/test_repo.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 970ba195..acf681ee 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -5,6 +5,9 @@ Changelog 1.0.2 - Fixes ============= +* IMPORTANT: Changed default object database of `Repo` objects to `GitComdObjectDB`. The pure-python implementation + used previously usually fails to release its resources (i.e. file handles), which can lead to problems when working + with large repositories. * CRITICAL: fixed incorrect `Commit` object serialization when authored or commit date had timezones which were not divisable by 3600 seconds. This would happen if the timezone was something like `+0530` for instance. * A list of all additional fixes can be found `on github `_ diff --git a/git/repo/base.py b/git/repo/base.py index 16fb58e5..d5bc24d8 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -35,10 +35,7 @@ from git.remote import ( add_progress ) -from git.db import ( - GitCmdObjectDB, - GitDB -) +from git.db import GitCmdObjectDB from gitdb.util import ( join, @@ -62,7 +59,7 @@ import os import sys import re -DefaultDBType = GitDB +DefaultDBType = GitCmdObjectDB if sys.version_info[:2] < (2, 5): # python 2.4 compatiblity DefaultDBType = GitCmdObjectDB # END handle python 2.4 diff --git a/git/test/test_repo.py b/git/test/test_repo.py index bc9f3e92..c95592ea 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -657,7 +657,7 @@ class TestRepo(TestBase): assert rev_parse('@{1}') != head.commit def test_repo_odbtype(self): - target_type = GitDB + target_type = GitCmdObjectDB if sys.version_info[:2] < (2, 5): target_type = GitCmdObjectDB assert isinstance(self.rorepo.odb, target_type) -- cgit v1.2.3