@@ -851,15 +851,19 @@ def clone(self, path, progress=None, **kwargs):
851851 return self ._clone (self .git , self .git_dir , path , type (self .odb ), progress , ** kwargs )
852852
853853 @classmethod
854- def clone_from (cls , url , to_path , progress = None , ** kwargs ):
854+ def clone_from (cls , url , to_path , progress = None , env = None , ** kwargs ):
855855 """Create a clone from the given URL
856856
857857 :param url: valid git url, see http://www.kernel.org/pub/software/scm/git/docs/git-clone.html#URLS
858858 :param to_path: Path to which the repository should be cloned to
859859 :param progress: See 'git.remote.Remote.push'.
860+ :param env: Optional dictionary containing the desired environment variables.
860861 :param kwargs: see the ``clone`` method
861862 :return: Repo instance pointing to the cloned directory"""
862- return cls ._clone (Git (os .getcwd ()), url , to_path , GitCmdObjectDB , progress , ** kwargs )
863+ git = Git (os .getcwd ())
864+ if env is not None :
865+ git .update_environment (** env )
866+ return cls ._clone (git , url , to_path , GitCmdObjectDB , progress , ** kwargs )
863867
864868 def archive (self , ostream , treeish = None , prefix = None , ** kwargs ):
865869 """Archive the tree at the given revision.
0 commit comments