From: Alex Riesen Date: Thu, 28 Aug 2008 17:19:42 +0000 (+0200) Subject: list_commands: only call git_exec_path if it is needed X-Git-Tag: v1.6.1-rc1~287 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=61c5d431deb0437b35c18d268c1957eefd1f4b91;p=git.git list_commands: only call git_exec_path if it is needed Even if it always needed Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/help.c b/help.c index ab2c2ba26..b278257aa 100644 --- a/help.c +++ b/help.c @@ -212,7 +212,6 @@ void load_command_list(const char *prefix, void list_commands(const char *title, struct cmdnames *main_cmds, struct cmdnames *other_cmds) { - const char *exec_path = git_exec_path(); int i, longest = 0; for (i = 0; i < main_cmds->cnt; i++) @@ -223,6 +222,7 @@ void list_commands(const char *title, struct cmdnames *main_cmds, longest = other_cmds->names[i]->len; if (main_cmds->cnt) { + const char *exec_path = git_exec_path(); printf("available %s in '%s'\n", title, exec_path); printf("----------------"); mput_char('-', strlen(title) + strlen(exec_path));