| 1311 | } |
| 1312 | |
| 1313 | static int run_rewrite_hook(const struct object_id *oldoid, |
| 1314 | const struct object_id *newoid) |
| 1315 | { |
| 1316 | struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT; |
| 1317 | int code; |
| 1318 | struct strbuf sb = STRBUF_INIT; |
| 1319 | |
| 1320 | strbuf_addf(&sb, "%s %s\n", oid_to_hex(oldoid), oid_to_hex(newoid)); |
| 1321 | |
| 1322 | opt.feed_pipe_ctx = &sb; |
| 1323 | opt.feed_pipe = pipe_from_strbuf; |
| 1324 | |
| 1325 | strvec_push(&opt.args, "amend"); |
| 1326 | |
| 1327 | code = run_hooks_opt(the_repository, "post-rewrite", &opt); |
| 1328 | |
| 1329 | strbuf_release(&sb); |
| 1330 | return code; |
| 1331 | } |
| 1332 | |
| 1333 | void commit_post_rewrite(struct repository *r, |
| 1334 | const struct commit *old_head, |
no test coverage detected