Merge branch 'jk/maint-1.6.5-reset-hard'
authorJunio C Hamano <gitster@pobox.com>
Sun, 10 Jan 2010 16:52:53 +0000 (08:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Jan 2010 16:52:53 +0000 (08:52 -0800)
* jk/maint-1.6.5-reset-hard:
reset: unbreak hard resets with GIT_WORK_TREE

1  2 
builtin-reset.c
diff --combined builtin-reset.c
index 31babd0b97b0d44ad09640bd73bc83eeed2ca0ad,e4418bced23807df174e600a4babbf1d604bac8e..5b647422d6d23c31ce568ea9ba3bf69eb39cec44
@@@ -202,7 -202,6 +202,7 @@@ int cmd_reset(int argc, const char **ar
        struct commit *commit;
        char *reflog_action, msg[1024];
        const struct option options[] = {
 +              OPT__QUIET(&quiet),
                OPT_SET_INT(0, "mixed", &reset_type,
                                                "reset HEAD and index", MIXED),
                OPT_SET_INT(0, "soft", &reset_type, "reset only HEAD", SOFT),
                                "reset HEAD, index and working tree", HARD),
                OPT_SET_INT(0, "merge", &reset_type,
                                "reset HEAD, index and working tree", MERGE),
 -              OPT_BOOLEAN('q', NULL, &quiet,
 -                              "disable showing new HEAD in hard reset and progress message"),
                OPT_BOOLEAN('p', "patch", &patch_mode, "select hunks interactively"),
                OPT_END()
        };
        if (reset_type == NONE)
                reset_type = MIXED; /* by default */
  
-       if ((reset_type == HARD || reset_type == MERGE)
-           && !is_inside_work_tree())
-               die("%s reset requires a work tree",
-                   reset_type_names[reset_type]);
+       if (reset_type == HARD || reset_type == MERGE)
+               setup_work_tree();
  
        /* Soft reset does not touch the index file nor the working tree
         * at all, but requires them in a good order.  Other resets reset