From: Junio C Hamano Date: Sun, 10 Jan 2010 16:52:53 +0000 (-0800) Subject: Merge branch 'jk/maint-1.6.5-reset-hard' X-Git-Tag: v1.7.0-rc0~109 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0b4ae29f0328fb8c270030abad132e8f50e05381?ds=inline;hp=-c Merge branch 'jk/maint-1.6.5-reset-hard' * jk/maint-1.6.5-reset-hard: reset: unbreak hard resets with GIT_WORK_TREE --- 0b4ae29f0328fb8c270030abad132e8f50e05381 diff --combined builtin-reset.c index 31babd0b97,e4418bced2..5b647422d6 --- a/builtin-reset.c +++ b/builtin-reset.c @@@ -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), @@@ -210,6 -209,8 +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() }; @@@ -285,10 -286,8 +285,8 @@@ 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