Code

Merge branch 'maint'
[git.git] / builtin-revert.c
index 62ab1fa1f484a113f45da96de8cd209a0c5c522e..365b330f9e1f2989683611077d260fa49abcb889 100644 (file)
@@ -246,7 +246,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)
        if (no_commit) {
                /*
                 * We do not intend to commit immediately.  We just want to
-                * merge the differences in.
+                * merge the differences in, so let's compute the tree
+                * that represents the "current" state for merge-recursive
+                * to work on.
                 */
                if (write_tree(head, 0, NULL))
                        die ("Your index file is unmerged.");
@@ -256,7 +258,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
                if (get_sha1("HEAD", head))
                        die ("You do not have a valid HEAD");
                wt_status_prepare(&s);
-               if (s.commitable || s.workdir_dirty)
+               if (s.commitable)
                        die ("Dirty index: cannot %s", me);
                discard_cache();
        }