{
struct lock_file index_lock = LOCK_INIT;
int index_fd = hold_locked_index(&index_lock, 0);
- if (read_index_preload(&the_index, NULL, 0) < 0) {
+ if (read_index(&the_index) < 0) {
rollback_lock_file(&index_lock);
return error(_("git %s: failed to read the index"),
_(action_name(opts)));
if (checkout_onto(opts, onto_name, oid_to_hex(&oid), orig_head))
return -1;
-;
+
if (require_clean_work_tree("rebase", "", 1, 1))
return -1;