summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-04 00:09:00 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-04 00:09:00 +0200
commitb01ca6a3e4ae9d944d799743c8ff774e2a7a82b6 (patch)
treec9361bd06ccc563f61ff4d59647fe4f3d35e3528 /lib/git/repo.py
parent1906ee4df9ae4e734288c5203cf79894dff76cab (diff)
downloadgitpython-b01ca6a3e4ae9d944d799743c8ff774e2a7a82b6.tar.gz
db: implemented GitObjectDB using the git command to make sure we can lookup everything. Next is to implement pack-file reading, then alternates which should allow to resolve everything
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 0bd2249c..1afb1eb7 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -13,7 +13,7 @@ from objects import *
from config import GitConfigParser
from remote import Remote
-from odb.db import LooseObjectDB
+from odb.db import GitObjectDB
import os
import sys
@@ -68,7 +68,7 @@ class Repo(object):
# represents the configuration level of a configuration file
config_level = ("system", "global", "repository")
- def __init__(self, path=None, odbt = LooseObjectDB):
+ def __init__(self, path=None, odbt = GitObjectDB):
""" Create a new Repo instance
:param path: is the path to either the root git directory or the bare git repo::
@@ -128,7 +128,12 @@ class Repo(object):
self.working_dir = self._working_tree_dir or self.git_dir
self.git = Git(self.working_dir)
- self.odb = odbt(os.path.join(self.git_dir, 'objects'))
+
+ # special handling, in special times
+ args = [os.path.join(self.git_dir, 'objects')]
+ if issubclass(odbt, GitObjectDB):
+ args.append(self.git)
+ self.odb = odbt(*args)
def __eq__(self, rhs):
if isinstance(rhs, Repo):