Merge branch 'fc/opt-quiet-gc-reset'
authorJunio C Hamano <gitster@pobox.com>
Sun, 10 Jan 2010 16:52:06 +0000 (08:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Jan 2010 16:52:06 +0000 (08:52 -0800)
* fc/opt-quiet-gc-reset:
General --quiet improvements

1  2 
builtin-reset.c
diff --combined builtin-reset.c
index 11d1c6e4d6d2ec0580cae3725f6b3a093e68aa67,25b38cee187f2d7473d25bbc462d4d30ec7266f2..31babd0b97b0d44ad09640bd73bc83eeed2ca0ad
@@@ -202,6 -202,7 +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 && is_bare_repository())
 -              die("hard reset makes no sense in a bare repository");
 +      if ((reset_type == HARD || reset_type == MERGE)
 +          && !is_inside_work_tree())
 +              die("%s reset requires a work tree",
 +                  reset_type_names[reset_type]);
  
        /* Soft reset does not touch the index file nor the working tree
         * at all, but requires them in a good order.  Other resets reset