Skip to content

Commit

Permalink
list_commands: only call git_exec_path if it is needed
Browse files Browse the repository at this point in the history
Even if it always needed

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Aug 29, 2008
1 parent 1f08e5c commit 61c5d43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand All @@ -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));
Expand Down

0 comments on commit 61c5d43

Please sign in to comment.