66from pre_commit_hooks .check_merge_conflict import main
77from pre_commit_hooks .util import cmd_output
88from testing .util import get_resource_path
9+ from testing .util import git_commit
910
1011
1112@pytest .fixture
@@ -20,19 +21,19 @@ def f1_is_a_conflict_file(tmpdir):
2021 with repo1 .as_cwd ():
2122 repo1_f1 .ensure ()
2223 cmd_output ('git' , 'add' , '.' )
23- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-m' , 'commit1' )
24+ git_commit ( '-m' , 'commit1' )
2425
2526 cmd_output ('git' , 'clone' , str (repo1 ), str (repo2 ))
2627
2728 # Commit in master
2829 with repo1 .as_cwd ():
2930 repo1_f1 .write ('parent\n ' )
30- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-am' , 'master commit2' )
31+ git_commit ( '-am' , 'master commit2' )
3132
3233 # Commit in clone and pull
3334 with repo2 .as_cwd ():
3435 repo2_f1 .write ('child\n ' )
35- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-am' , 'clone commit2' )
36+ git_commit ( '-am' , 'clone commit2' )
3637 cmd_output ('git' , 'pull' , '--no-rebase' , retcode = None )
3738 # We should end up in a merge conflict!
3839 f1 = repo2_f1 .read ()
@@ -75,20 +76,20 @@ def repository_pending_merge(tmpdir):
7576 with repo1 .as_cwd ():
7677 repo1_f1 .ensure ()
7778 cmd_output ('git' , 'add' , '.' )
78- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-m' , 'commit1' )
79+ git_commit ( '-m' , 'commit1' )
7980
8081 cmd_output ('git' , 'clone' , str (repo1 ), str (repo2 ))
8182
8283 # Commit in master
8384 with repo1 .as_cwd ():
8485 repo1_f1 .write ('parent\n ' )
85- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-am' , 'master commit2' )
86+ git_commit ( '-am' , 'master commit2' )
8687
8788 # Commit in clone and pull without committing
8889 with repo2 .as_cwd ():
8990 repo2_f2 .write ('child\n ' )
9091 cmd_output ('git' , 'add' , '.' )
91- cmd_output ( 'git' , 'commit' , '--no-gpg-sign' , '-m' , 'clone commit2' )
92+ git_commit ( '-m' , 'clone commit2' )
9293 cmd_output ('git' , 'pull' , '--no-commit' , '--no-rebase' )
9394 # We should end up in a pending merge
9495 assert repo2_f1 .read () == 'parent\n '
0 commit comments