Skip to content

Commit 640d150

Browse files
committed
Merge pull request #291 from hvnsweeting/support-init-choosing-backend
support passing odbt for using with Repo
2 parents 4a771ad + 643e636 commit 640d150

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git/repo/base.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def blame(self, rev, file):
744744
return blames
745745

746746
@classmethod
747-
def init(cls, path=None, mkdir=True, **kwargs):
747+
def init(cls, path=None, mkdir=True, odbt=DefaultDBType, **kwargs):
748748
"""Initialize a git repository at the given path if specified
749749
750750
:param path:
@@ -757,6 +757,11 @@ def init(cls, path=None, mkdir=True, **kwargs):
757757
already exists. Creates the directory with a mode=0755.
758758
Only effective if a path is explicitly given
759759
760+
:param odbt:
761+
Object DataBase type - a type which is constructed by providing
762+
the directory containing the database objects, i.e. .git/objects.
763+
It will be used to access all object data
764+
760765
:parm kwargs:
761766
keyword arguments serving as additional options to the git-init command
762767
@@ -769,7 +774,7 @@ def init(cls, path=None, mkdir=True, **kwargs):
769774
# git command automatically chdir into the directory
770775
git = Git(path)
771776
git.init(**kwargs)
772-
return cls(path)
777+
return cls(path, odbt=odbt)
773778

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

0 commit comments

Comments
 (0)