From c1d5c614c38db015485190d65db05b0b75d171d4 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Viet Date: Mon, 1 Jun 2015 11:02:41 +0700 Subject: [PATCH 1/2] support passing odbt for using with Repo --- git/repo/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git/repo/base.py b/git/repo/base.py index e59cb0c7d..45550826c 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -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: @@ -762,7 +762,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): From 643e6369553759407ca433ed51a5a06b47e763d4 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Viet Date: Mon, 1 Jun 2015 14:34:14 +0700 Subject: [PATCH 2/2] add docstring for new arg --- git/repo/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git/repo/base.py b/git/repo/base.py index 45550826c..c8915bbc4 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -750,6 +750,11 @@ def init(cls, path=None, mkdir=True, odbt=DefaultDBType, **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