summaryrefslogtreecommitdiff
path: root/builtin-reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-reset.c')
-rw-r--r--builtin-reset.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin-reset.c b/builtin-reset.c
index 2c880a7e7a..0f5022eed2 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -221,6 +221,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
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),
@@ -228,8 +229,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
"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()
};
@@ -305,10 +304,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
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();
if (reset_type == MIXED && is_bare_repository())
die("%s reset is not allowed in a bare repository",