1515from git import Repo , Remote , GitCommandError , Git
1616from git .compat import string_types
1717
18- GIT_REPO = os .path .dirname (os .path .dirname (os .path .dirname (os .path .dirname (__file__ ))))
18+ osp = os .path .dirname
19+
20+ GIT_REPO = os .environ .get ("GIT_PYTHON_TEST_GIT_REPO_BASE" , osp (osp (osp (osp (__file__ )))))
1921
2022__all__ = (
2123 'fixture_path' , 'fixture' , 'absolute_project_path' , 'StringProcessAdapter' ,
2628
2729
2830def fixture_path (name ):
29- test_dir = os . path . dirname ( os . path . dirname (__file__ ))
31+ test_dir = osp ( osp (__file__ ))
3032 return os .path .join (test_dir , "fixtures" , name )
3133
3234
@@ -35,7 +37,7 @@ def fixture(name):
3537
3638
3739def absolute_project_path ():
38- return os .path .abspath (os .path .join (os . path . dirname (__file__ ), ".." , ".." ))
40+ return os .path .abspath (os .path .join (osp (__file__ ), ".." , ".." ))
3941
4042#} END routines
4143
@@ -195,7 +197,7 @@ def remote_repo_creator(self):
195197
196198 d_remote .config_writer .set ('url' , remote_repo_url )
197199
198- temp_dir = os . path . dirname (_mktemp ())
200+ temp_dir = osp (_mktemp ())
199201 # On windows, this will fail ... we deal with failures anyway and default to telling the user to do it
200202 try :
201203 gd = Git ().daemon (temp_dir , enable = 'receive-pack' , as_process = True )
0 commit comments