OSDN Git Service

Merge branch 'bc/submitting-patches-in-asciidoc'
[git-core/git.git] / merge-recursive.c
index 2ecf495..780f81a 100644 (file)
@@ -1952,6 +1952,13 @@ int merge_trees(struct merge_options *o,
        }
 
        if (oid_eq(&common->object.oid, &merge->object.oid)) {
+               struct strbuf sb = STRBUF_INIT;
+
+               if (index_has_changes(&sb)) {
+                       err(o, _("Dirty index: cannot merge (dirty: %s)"),
+                           sb.buf);
+                       return 0;
+               }
                output(o, 0, _("Already up to date!"));
                *result = head;
                return 1;