index_has_changes(): avoid assuming operating on the_index
[gitweb.git] / merge-recursive.c
index 869092f7b9bc0ce1104a1c43c7201acdee2eb4f8..32529ca5b6afec8129be20037ee85cf8d8cdf5c2 100644 (file)
@@ -1983,7 +1983,7 @@ int merge_trees(struct merge_options *o,
        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;