Skip to content

Commit 61c5d43

Browse files
raalkmlgitster
authored andcommitted
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>
1 parent 1f08e5c commit 61c5d43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

help.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ void load_command_list(const char *prefix,
212212
void list_commands(const char *title, struct cmdnames *main_cmds,
213213
struct cmdnames *other_cmds)
214214
{
215-
const char *exec_path = git_exec_path();
216215
int i, longest = 0;
217216

218217
for (i = 0; i < main_cmds->cnt; i++)
@@ -223,6 +222,7 @@ void list_commands(const char *title, struct cmdnames *main_cmds,
223222
longest = other_cmds->names[i]->len;
224223

225224
if (main_cmds->cnt) {
225+
const char *exec_path = git_exec_path();
226226
printf("available %s in '%s'\n", title, exec_path);
227227
printf("----------------");
228228
mput_char('-', strlen(title) + strlen(exec_path));

0 commit comments

Comments
 (0)