@@ -62,12 +62,12 @@ def test_autoupdate_old_revision_broken(
6262 path = make_repo (tempdir_factory , 'python_hooks_repo' )
6363 config = make_config_from_repo (path , check = False )
6464
65- cmd_output ('git' , '-C' , path , ' mv' , C .MANIFEST_FILE , 'nope.yaml' )
66- cmd_output ('git' , '-C' , path , ' commit' , '-m' , 'simulate old repo' )
65+ cmd_output ('git' , 'mv' , C .MANIFEST_FILE , 'nope.yaml' , cwd = path )
66+ cmd_output ('git' , 'commit' , '-m' , 'simulate old repo' , cwd = path )
6767 # Assume this is the revision the user's old repository was at
6868 rev = git .head_rev (path )
69- cmd_output ('git' , '-C' , path , ' mv' , 'nope.yaml' , C .MANIFEST_FILE )
70- cmd_output ('git' , '-C' , path , ' commit' , '-m' , 'move hooks file' )
69+ cmd_output ('git' , 'mv' , 'nope.yaml' , C .MANIFEST_FILE , cwd = path )
70+ cmd_output ('git' , 'commit' , '-m' , 'move hooks file' , cwd = path )
7171 update_rev = git .head_rev (path )
7272
7373 config ['rev' ] = rev
@@ -86,7 +86,7 @@ def out_of_date_repo(tempdir_factory):
8686 original_rev = git .head_rev (path )
8787
8888 # Make a commit
89- cmd_output ('git' , '-C' , path , ' commit' , '--allow-empty' , '-m' , 'foo' )
89+ cmd_output ('git' , 'commit' , '--allow-empty' , '-m' , 'foo' , cwd = path )
9090 head_rev = git .head_rev (path )
9191
9292 yield auto_namedtuple (
@@ -221,7 +221,7 @@ def test_loses_formatting_when_not_detectable(
221221
222222@pytest .fixture
223223def tagged_repo (out_of_date_repo ):
224- cmd_output ('git' , '-C' , out_of_date_repo . path , ' tag' , 'v1.2.3' )
224+ cmd_output ('git' , 'tag' , 'v1.2.3' , cwd = out_of_date_repo . path )
225225 yield out_of_date_repo
226226
227227
@@ -240,8 +240,7 @@ def test_autoupdate_tagged_repo(
240240
241241@pytest .fixture
242242def tagged_repo_with_more_commits (tagged_repo ):
243- cmd = ('git' , '-C' , tagged_repo .path , 'commit' , '--allow-empty' , '-mfoo' )
244- cmd_output (* cmd )
243+ cmd_output ('git' , 'commit' , '--allow-empty' , '-mfoo' , cwd = tagged_repo .path )
245244 yield tagged_repo
246245
247246
@@ -268,8 +267,8 @@ def hook_disappearing_repo(tempdir_factory):
268267 get_resource_path ('manifest_without_foo.yaml' ),
269268 os .path .join (path , C .MANIFEST_FILE ),
270269 )
271- cmd_output ('git' , '-C' , path , ' add' , '.' )
272- cmd_output ('git' , '-C' , path , ' commit' , '-m' , 'Remove foo' )
270+ cmd_output ('git' , 'add' , '.' , cwd = path )
271+ cmd_output ('git' , 'commit' , '-m' , 'Remove foo' , cwd = path )
273272
274273 yield auto_namedtuple (path = path , original_rev = original_rev )
275274
0 commit comments