Skip to content

Commit

Permalink
Merge pull request #291 from hvnsweeting/support-init-choosing-backend
Browse files Browse the repository at this point in the history
support passing odbt for using with Repo
  • Loading branch information
Byron committed Jun 10, 2015
2 parents 4a771ad + 643e636 commit 640d150
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def blame(self, rev, file):
return blames

@classmethod
def init(cls, path=None, mkdir=True, **kwargs):
def init(cls, path=None, mkdir=True, odbt=DefaultDBType, **kwargs):
"""Initialize a git repository at the given path if specified
:param path:
Expand All @@ -757,6 +757,11 @@ def init(cls, path=None, mkdir=True, **kwargs):
already exists. Creates the directory with a mode=0755.
Only effective if a path is explicitly given
:param odbt:
Object DataBase type - a type which is constructed by providing
the directory containing the database objects, i.e. .git/objects.
It will be used to access all object data
:parm kwargs:
keyword arguments serving as additional options to the git-init command
Expand All @@ -769,7 +774,7 @@ def init(cls, path=None, mkdir=True, **kwargs):
# git command automatically chdir into the directory
git = Git(path)
git.init(**kwargs)
return cls(path)
return cls(path, odbt=odbt)

@classmethod
def _clone(cls, git, url, path, odb_default_type, progress, **kwargs):
Expand Down

0 comments on commit 640d150

Please sign in to comment.