Execute a hook if the hook exists.
(cmd, param=[])
| 316 | |
| 317 | |
| 318 | def run_git_hook(cmd, param=[]): |
| 319 | """Execute a hook if the hook exists.""" |
| 320 | args = ['git', 'hook', 'run', '--ignore-missing', cmd] |
| 321 | if param: |
| 322 | args.append("--") |
| 323 | for p in param: |
| 324 | args.append(p) |
| 325 | return subprocess.call(args) == 0 |
| 326 | |
| 327 | |
| 328 | def write_pipe(c, stdin, *k, **kw): |
no test coverage detected