292
&revisions, &shortrevisions))
293
goto cleanup;
294
295
- if (init_basic_state(&replay,
296
- opts->head_name ? opts->head_name : "detached HEAD",
297
- opts->onto, &opts->orig_head->object.oid))
298
- goto cleanup;
299
-
300
- if (!opts->upstream && opts->squash_onto)
301
- write_file(path_squash_onto(), "%s\n",
302
- oid_to_hex(opts->squash_onto));
303
-
295
strvec_pushl(&make_script_args, "", revisions, NULL);
296
if (opts->restrict_revision)
297
strvec_pushf(&make_script_args, "^%s",
300
ret = sequencer_make_script(the_repository, &todo_list.buf,
301
make_script_args.nr, make_script_args.v,
302
flags);
312
-
313
- if (ret)
303
+ if (ret) {
304
error(_("could not generate todo list"));
315
- else {
316
- discard_index(the_repository->index);
317
- if (todo_list_parse_insn_buffer(the_repository, &replay,
318
- todo_list.buf.buf, &todo_list))
319
- BUG("unusable todo list");
320
-
321
- ret = complete_action(the_repository, &replay, flags,
322
- shortrevisions, opts->onto_name, opts->onto,
323
- &opts->orig_head->object.oid, &opts->exec,
324
- opts->autosquash, opts->update_refs, &todo_list);
305
+ goto cleanup;
306
}
307
308
+ if (init_basic_state(&replay,
309
+ opts->head_name ? opts->head_name : "detached HEAD",
310
+ opts->onto, &opts->orig_head->object.oid))
311
+ goto cleanup;
312
+
313
+ if (!opts->upstream && opts->squash_onto)
314
+ write_file(path_squash_onto(), "%s\n",
315
+ oid_to_hex(opts->squash_onto));
316
+
317
+ discard_index(the_repository->index);
318
+ if (todo_list_parse_insn_buffer(the_repository, &replay,
319
+ todo_list.buf.buf, &todo_list))
320
+ BUG("unusable todo list");
321
+
322
+ ret = complete_action(the_repository, &replay, flags,
323
+ shortrevisions, opts->onto_name, opts->onto,
324
+ &opts->orig_head->object.oid, &opts->exec,
325
+ opts->autosquash, opts->update_refs, &todo_list);
326
+
327
cleanup:
328
replay_opts_release(&replay);
329
free(revisions);