* Writes `commit` as a patch to the state directory's "patch" file. */
| 1396 | * Writes `commit` as a patch to the state directory's "patch" file. |
| 1397 | */ |
| 1398 | static void write_commit_patch(const struct am_state *state, struct commit *commit) |
| 1399 | { |
| 1400 | struct rev_info rev_info; |
| 1401 | FILE *fp; |
| 1402 | |
| 1403 | fp = xfopen(am_path(state, "patch"), "w"); |
| 1404 | repo_init_revisions(the_repository, &rev_info, NULL); |
| 1405 | rev_info.diff = 1; |
| 1406 | rev_info.abbrev = 0; |
| 1407 | rev_info.disable_stdin = 1; |
| 1408 | rev_info.show_root_diff = 1; |
| 1409 | rev_info.diffopt.output_format = DIFF_FORMAT_PATCH; |
| 1410 | rev_info.no_commit_id = 1; |
| 1411 | rev_info.diffopt.flags.binary = 1; |
| 1412 | rev_info.diffopt.flags.full_index = 1; |
| 1413 | rev_info.diffopt.use_color = GIT_COLOR_NEVER; |
| 1414 | rev_info.diffopt.file = fp; |
| 1415 | rev_info.diffopt.close_file = 1; |
| 1416 | add_pending_object(&rev_info, &commit->object, ""); |
| 1417 | diff_setup_done(&rev_info.diffopt); |
| 1418 | log_tree_commit(&rev_info, commit); |
| 1419 | release_revisions(&rev_info); |
| 1420 | } |
| 1421 | |
| 1422 | /** |
| 1423 | * Writes the diff of the index against HEAD as a patch to the state |
no test coverage detected