From ac62760c52abf28d1fd863f0c0dd48bc4a23d223 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 21 Jun 2010 12:51:46 +0200 Subject: index.add: now uses gitdb.store functionality instead of git-hash-file. The python version is about as fast, but could support multithreading using async --- lib/git/repo.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/git/repo.py') diff --git a/lib/git/repo.py b/lib/git/repo.py index ac8ee590..74525403 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -723,16 +723,17 @@ class Repo(object): return Repo(path) def clone(self, path, **kwargs): - """ - Create a clone from this repository. - - ``path`` + """Create a clone from this repository. + :param path: is the full path of the new repo (traditionally ends with ./.git). - ``kwargs`` - keyword arguments to be given to the git-clone command - - Returns + :param kwargs: + odbt = ObjectDatabase Type, allowing to determine the object database + implementation used by the returned Repo instance + + All remaining keyword arguments are given to the git-clone command + + :return: ``git.Repo`` (the newly cloned repo) """ # special handling for windows for path at which the clone should be @@ -741,6 +742,7 @@ class Repo(object): # we at least give a proper error instead of letting git fail prev_cwd = None prev_path = None + odbt = kwargs.pop('odbt', GitCmdObjectDB) if os.name == 'nt': if '~' in path: raise OSError("Git cannot handle the ~ character in path %r correctly" % path) @@ -767,7 +769,7 @@ class Repo(object): path = prev_path # END reset previous working dir # END bad windows handling - return Repo(path) + return Repo(path, odbt = odbt) def archive(self, ostream, treeish=None, prefix=None, **kwargs): -- cgit v1.2.1