diff options
Diffstat (limited to 'sequencer.c')
| -rw-r--r-- | sequencer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c index 119564f435..55ed074ae7 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4115,6 +4115,7 @@ void create_autostash(struct repository *r, const char *path) if (has_unstaged_changes(r, 1) || has_uncommitted_changes(r, 1)) { struct child_process stash = CHILD_PROCESS_INIT; + struct reset_head_opts ropts = { .flags = RESET_HEAD_HARD }; struct object_id oid; strvec_pushl(&stash.args, @@ -4136,10 +4137,8 @@ void create_autostash(struct repository *r, const char *path) path); write_file(path, "%s", oid_to_hex(&oid)); printf(_("Created autostash: %s\n"), buf.buf); - if (reset_head(r, NULL, NULL, RESET_HEAD_HARD, NULL, NULL, - NULL) < 0) + if (reset_head(r, &ropts) < 0) die(_("could not reset --hard")); - if (discard_index(r->index) < 0 || repo_read_index(r) < 0) die(_("could not read index")); |
