(*args, fn=cmd_output, msg='commit!', all_files=True, **kwargs)
| 97 | |
| 98 | |
| 99 | def git_commit(*args, fn=cmd_output, msg='commit!', all_files=True, **kwargs): |
| 100 | kwargs.setdefault('stderr', subprocess.STDOUT) |
| 101 | |
| 102 | cmd = ('git', 'commit', '--allow-empty', '--no-gpg-sign', *args) |
| 103 | if all_files: # allow skipping `-a` with `all_files=False` |
| 104 | cmd += ('-a',) |
| 105 | if msg is not None: # allow skipping `-m` with `msg=None` |
| 106 | cmd += ('-m', msg) |
| 107 | ret, out, _ = fn(*cmd, **kwargs) |
| 108 | return ret, out.replace('\r\n', '\n') |
no outgoing calls