| 513 | } |
| 514 | |
| 515 | static int rebase_write_basic_state(struct rebase_options *opts) |
| 516 | { |
| 517 | write_file(state_dir_path("head-name", opts), "%s", |
| 518 | opts->head_name ? opts->head_name : "detached HEAD"); |
| 519 | write_file(state_dir_path("onto", opts), "%s", |
| 520 | opts->onto ? oid_to_hex(&opts->onto->object.oid) : ""); |
| 521 | write_file(state_dir_path("orig-head", opts), "%s", |
| 522 | oid_to_hex(&opts->orig_head->object.oid)); |
| 523 | if (!(opts->flags & REBASE_NO_QUIET)) |
| 524 | write_file(state_dir_path("quiet", opts), "%s", ""); |
| 525 | if (opts->flags & REBASE_VERBOSE) |
| 526 | write_file(state_dir_path("verbose", opts), "%s", ""); |
| 527 | if (opts->allow_rerere_autoupdate > 0) |
| 528 | write_file(state_dir_path("allow_rerere_autoupdate", opts), |
| 529 | "-%s-rerere-autoupdate", |
| 530 | opts->allow_rerere_autoupdate == RERERE_AUTOUPDATE ? |
| 531 | "" : "-no"); |
| 532 | if (opts->gpg_sign_opt) |
| 533 | write_file(state_dir_path("gpg_sign_opt", opts), "%s", |
| 534 | opts->gpg_sign_opt); |
| 535 | if (opts->signoff) |
| 536 | write_file(state_dir_path("signoff", opts), "--signoff"); |
| 537 | |
| 538 | return 0; |
| 539 | } |
| 540 | |
| 541 | static int cleanup_autostash(struct rebase_options *opts) |
| 542 | { |
no test coverage detected