Skip to content

Commit afeac2f

Browse files
committed
Don't fail if GPG signing is configured by default
1 parent 51659ee commit afeac2f

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

testing/fixtures.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def make_repo(tempdir_factory, repo_source):
4848
path = git_dir(tempdir_factory)
4949
copy_tree_to_path(get_resource_path(repo_source), path)
5050
cmd_output('git', 'add', '.', cwd=path)
51-
cmd_output('git', 'commit', '-m', 'Add hooks', cwd=path)
51+
cmd_output('git', 'commit', '--no-gpg-sign', '-m', 'Add hooks', cwd=path)
5252
return path
5353

5454

@@ -64,7 +64,8 @@ def modify_manifest(path):
6464
with io.open(manifest_path, 'w') as manifest_file:
6565
manifest_file.write(ordered_dump(manifest, **C.YAML_DUMP_KWARGS))
6666
cmd_output(
67-
'git', 'commit', '-am', 'update {}'.format(C.MANIFEST_FILE), cwd=path,
67+
'git', 'commit', '--no-gpg-sign', '-am',
68+
'update {}'.format(C.MANIFEST_FILE), cwd=path,
6869
)
6970

7071

@@ -80,7 +81,9 @@ def modify_config(path='.', commit=True):
8081
with io.open(config_path, 'w', encoding='UTF-8') as config_file:
8182
config_file.write(ordered_dump(config, **C.YAML_DUMP_KWARGS))
8283
if commit:
83-
cmd_output('git', 'commit', '-am', 'update config', cwd=path)
84+
cmd_output(
85+
'git', 'commit', '--no-gpg-sign', '-am', 'update config', cwd=path,
86+
)
8487

8588

8689
def config_with_local_hooks():
@@ -136,13 +139,19 @@ def write_config(directory, config, config_file=C.CONFIG_FILE):
136139
def add_config_to_repo(git_path, config, config_file=C.CONFIG_FILE):
137140
write_config(git_path, config, config_file=config_file)
138141
cmd_output('git', 'add', config_file, cwd=git_path)
139-
cmd_output('git', 'commit', '-m', 'Add hooks config', cwd=git_path)
142+
cmd_output(
143+
'git', 'commit', '--no-gpg-sign', '-m', 'Add hooks config',
144+
cwd=git_path,
145+
)
140146
return git_path
141147

142148

143149
def remove_config_from_repo(git_path, config_file=C.CONFIG_FILE):
144150
cmd_output('git', 'rm', config_file, cwd=git_path)
145-
cmd_output('git', 'commit', '-m', 'Remove hooks config', cwd=git_path)
151+
cmd_output(
152+
'git', 'commit', '--no-gpg-sign', '-m', 'Remove hooks config',
153+
cwd=git_path,
154+
)
146155
return git_path
147156

148157

0 commit comments

Comments
 (0)