shortlog: run setup_git_directory_gently() sooner
shortlog already runs a repository search unconditionally; running such a search earlier is not very risky. Without this change, the “[pager] shortlog” configuration is not respected at all: “git shortlog” unconditionally paginates. The tests are a bit slow. Running the full battery like this for all built-in commands would be counterproductive; the intent is rather to test shortlog as a representative example command using ..._gently(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
ee38dfb89e
commit
773b69bf71
@ -249,7 +249,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
static struct shortlog log;
|
||||
static struct rev_info rev;
|
||||
int nongit;
|
||||
int nongit = !startup_info->have_repository;
|
||||
|
||||
static const struct option options[] = {
|
||||
OPT_BOOLEAN('n', "numbered", &log.sort_by_number,
|
||||
@ -265,7 +265,6 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
|
||||
|
||||
struct parse_opt_ctx_t ctx;
|
||||
|
||||
prefix = setup_git_directory_gently(&nongit);
|
||||
git_config(git_default_config, NULL);
|
||||
shortlog_init(&log);
|
||||
init_revisions(&rev, prefix);
|
||||
|
Reference in New Issue
Block a user