git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] list_commands: only call git_exec_path if it is needed

From
Alex Riesen <raa.lkml@gmail.com>
Date
Aug 28, 2008, 17:19 UTC
Message-ID
<20080828171942.GE6024@blimp.local>
Even if it always needed
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 help.c |    2 +-
 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));
-- 
1.6.0.1.150.g5966
Message 1 of 1 in “list_commands: only call git_exec_path if it is needed”
  1. list_commands: only call git_exec_path if it is neededAlex Riesen, Aug 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.