path: root/builtin/shortlog.c
diff options
authorNguyễn Thái Ngọc Duy <>2010-08-06 03:01:37 (GMT)
committerJunio C Hamano <>2010-08-11 16:24:01 (GMT)
commit773b69bf7189f5babb26b899b4c35f604cd993c7 (patch)
treeb72bf725b90cd155e11d21ea3fb5205212eb955f /builtin/shortlog.c
parentee38dfb89ef88a3e4e6818b7cfe31d122a1c640d (diff)
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 <> Signed-off-by: Junio C Hamano <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/shortlog.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 0a9681b..2135b0d 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -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);
init_revisions(&rev, prefix);