OSDN Git Service

worktree: honor configuration variables
authorJunio C Hamano <gitster@pobox.com>
Tue, 27 Sep 2016 06:49:39 +0000 (23:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Sep 2016 17:51:33 +0000 (10:51 -0700)
The command accesses default_abbrev (defined in environment.c and is
updated via core.abbrev configuration), but never makes any call to
git_config().  The output from "worktree list" ignores the abbrev
setting for this reason.

Make a call to git_config() to read the default set of configuration
variables at the beginning of the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c

index 6dcf7bd..5c4854d 100644 (file)
@@ -528,6 +528,8 @@ int cmd_worktree(int ac, const char **av, const char *prefix)
                OPT_END()
        };
 
+       git_config(git_default_config, NULL);
+
        if (ac < 2)
                usage_with_options(worktree_usage, options);
        if (!prefix)