read-tree: add --quiet
read-tree is basically the front end of unpack-trees code and shoud expose all of its functionality (unless it's designed for internal use). This "opts.quiet" (formerly "opts.gently") was added for builtin/checkout.c but there is no reason why other read-tree users won't find this useful. The test that is updated to run 'read-tree --quiet' was added because unpack-trees was accidentally not being quiet [1] in6a143aa2b2(checkout -m: attempt merge when deletion of path was staged - 2014-08-12). Because checkout is the only "opts.quiet" user, there was no other way to test quiet behavior. But we can now test it directly.6a143aa2b2was manually reverted to verify that read-tree --quiet works correctly (i.e. test_must_be_empty fails). [1] the commit message there say "errors out instead of performing a merge" but I'm pretty sure the "performing a merge" happens anyway even before that commit. That line should say "errors out _in addition to_ performing a merge" Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
b165fac8c1
commit
3e41485d85
@ -154,6 +154,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
|
||||
{ OPTION_CALLBACK, 0, "recurse-submodules", NULL,
|
||||
"checkout", "control recursive updating of submodules",
|
||||
PARSE_OPT_OPTARG, option_parse_recurse_submodules_worktree_updater },
|
||||
OPT__QUIET(&opts.quiet, N_("suppress feedback messages")),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user