summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-08-28 17:19:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-29 04:51:34 (GMT)
commit61c5d431deb0437b35c18d268c1957eefd1f4b91 (patch)
tree48fdb955ae5240417914a81860ffd6c6a519cf00 /help.c
parent1f08e5ce2435f1d5c78a31c0a783d5bb177cd657 (diff)
downloadgit-61c5d431deb0437b35c18d268c1957eefd1f4b91.zip
git-61c5d431deb0437b35c18d268c1957eefd1f4b91.tar.gz
git-61c5d431deb0437b35c18d268c1957eefd1f4b91.tar.bz2
list_commands: only call git_exec_path if it is needed
Even if it always needed Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/help.c b/help.c
index ab2c2ba..b278257 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));