status = run_command(&cmd);
/* force re-reading of the cache */
- if (discard_index(r->index) < 0 || repo_read_index(r) < 0)
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
return error(_("could not read index"));
dirty = require_clean_work_tree(r, "rebase", NULL, 1, 1);
ret = run_command(&cmd);
/* force re-reading of the cache */
- if (!ret && (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0))
- ret = error(_("could not read index"));
+ if (!ret) {
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
+ ret = error(_("could not read index"));
+ }
goto leave_merge;
}
printf(_("Created autostash: %s\n"), buf.buf);
if (reset_head(r, &ropts) < 0)
die(_("could not reset --hard"));
- if (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0)
+ discard_index(r->index);
+ if (repo_read_index(r) < 0)
die(_("could not read index"));
}
strbuf_release(&buf);