From: Junio C Hamano Date: Sun, 10 Jan 2010 16:52:06 +0000 (-0800) Subject: Merge branch 'fc/opt-quiet-gc-reset' X-Git-Tag: v1.7.0-rc0~116 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ed7e9ed5cdad5c3a5b947619a34154f5a0ebc020?hp=-c Merge branch 'fc/opt-quiet-gc-reset' * fc/opt-quiet-gc-reset: General --quiet improvements --- ed7e9ed5cdad5c3a5b947619a34154f5a0ebc020 diff --combined builtin-reset.c index 11d1c6e4d6,25b38cee18..31babd0b97 --- a/builtin-reset.c +++ b/builtin-reset.c @@@ -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), @@@ -209,8 -210,6 +210,6 @@@ "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() }; @@@ -286,10 -285,8 +285,10 @@@ 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