t6044: add more testcases with staged changes before a merge is invoked
[gitweb.git] / merge-recursive.c
index 2fb1bdb0107fb0b38aec873e8b75eaa95b68ba50..171587bc7aab23bd7576ca7a5c2ad7d5ef42a942 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(&the_index, &sb)) {
+               if (!o->call_depth && index_has_changes(&the_index, head, &sb)) {
                        err(o, _("Your local changes to the following files would be overwritten by merge:\n  %s"),
                            sb.buf);
                        return -1;