if (oid_eq(&common->object.oid, &merge->object.oid)) {
struct strbuf sb = STRBUF_INIT;
- if (!o->call_depth && index_has_changes(&sb)) {
+ if (!o->call_depth && index_has_changes(&the_index, &sb)) {
err(o, _("Dirty index: cannot merge (dirty: %s)"),
sb.buf);
return 0;