Skip to content

support passing odbt for using with Repo #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,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 @@ -750,6 +750,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 @@ -762,7 +767,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