@matheusbsbs / matheus-bagliano / commits / 61c5d431de
Fork 0

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>

Alex Riesen committed Aug 28, 2008 at 19:19 UTC 61c5d431deb0437b35c18d268c1957eefd1f4b91
1 file changed +1 -1
help.c
+1 -1
@@ -212,7 +212,6 @@ void load_command_list(const char *prefix,
212 void list_commands(const char *title, struct cmdnames *main_cmds,
213 struct cmdnames *other_cmds)
214 {
215 - const char *exec_path = git_exec_path();
215 int i, longest = 0;
216
217 for (i = 0; i < main_cmds->cnt; i++)
@@ -223,6 +222,7 @@ void list_commands(const char *title, struct cmdnames *main_cmds,
222 longest = other_cmds->names[i]->len;
223
224 if (main_cmds->cnt) {
225 + const char *exec_path = git_exec_path();
226 printf("available %s in '%s'\n", title, exec_path);
227 printf("----------------");
228 mput_char('-', strlen(title) + strlen(exec_path));