MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / git_commit

Function git_commit

testing/util.py:99–108  ·  view source on GitHub ↗
(*args, fn=cmd_output, msg='commit!', all_files=True, **kwargs)

Source from the content-addressed store, hash-verified

97
98
99def 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')

Calls

no outgoing calls