@@ -41,6 +41,12 @@ class GitCommandMixin(object):
41
41
42
42
git_bin = locate ('git' )
43
43
44
+ _git_opts = (
45
+ '-c' , 'init.defaultBranch=master' ,
46
+ '-c' , 'protocol.file.allow=always' ,
47
+ '-c' , 'core.protectNTFS=false' ,
48
+ )
49
+
44
50
def _git_commit (self , * args , ** kwargs ):
45
51
env = kwargs .get ('env' ) or os .environ .copy ()
46
52
if 'date' in kwargs :
@@ -50,16 +56,14 @@ def _git_commit(self, *args, **kwargs):
50
56
return self ._git (* args , ** kwargs )
51
57
52
58
def _spawn_git (self , * args , ** kwargs ):
53
- args = (self .git_bin ,) + args
59
+ args = (self .git_bin ,) + self . _git_opts + args
54
60
kwargs .setdefault ('stdin' , DEVNULL )
55
61
kwargs .setdefault ('stdout' , PIPE )
56
62
kwargs .setdefault ('stderr' , PIPE )
57
63
kwargs .setdefault ('cwd' , self .repos_path )
58
64
return Popen (args , close_fds = close_fds , ** kwargs )
59
65
60
66
def _git (self , * args , ** kwargs ):
61
- args = ('-c' , 'init.defaultBranch=master' ,
62
- '-c' , 'protocol.file.allow=always' ) + args
63
67
with self ._spawn_git (* args , ** kwargs ) as proc :
64
68
stdout , stderr = proc .communicate ()
65
69
self .assertEqual (0 , proc .returncode ,
0 commit comments