mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Don't fail if GPG signing is configured by default. All references.
This commit is contained in:
parent
7afb2944b2
commit
28c97a95cd
10 changed files with 60 additions and 50 deletions
|
|
@ -133,3 +133,18 @@ def cwd(path):
|
|||
yield
|
||||
finally:
|
||||
os.chdir(original_cwd)
|
||||
|
||||
|
||||
def git_commit(msg, *_args, **kwargs):
|
||||
args = ['git']
|
||||
config = kwargs.pop('config', None)
|
||||
if config is not None:
|
||||
args.extend(['-C', config])
|
||||
args.append('commit')
|
||||
if msg is not None:
|
||||
args.extend(['-m', msg])
|
||||
if '--allow-empty' not in _args:
|
||||
args.append('--allow-empty')
|
||||
if '--no-gpg-sign' not in _args:
|
||||
args.append('--no-gpg-sign')
|
||||
return cmd_output(*(tuple(args) + tuple(_args)), **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue