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

[PATCH v2 1/2] fetch: convert argv_gc_auto to struct argv_array

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Aug 16, 2014, 01:19 UTC
Message-ID
<1408151968-30294-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<1408017065-17437-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/fetch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index e8d0cca..5f06114 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1110,9 +1110,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 	struct string_list list = STRING_LIST_INIT_NODUP;
 	struct remote *remote;
 	int result = 0;
-	static const char *argv_gc_auto[] = {
-		"gc", "--auto", NULL,
-	};
+	struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
 
 	packet_trace_identity("fetch");
 
@@ -1198,7 +1196,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 	list.strdup_strings = 1;
 	string_list_clear(&list, 0);
 
-	run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+	argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
+	run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);
+	argv_array_clear(&argv_gc_auto);
 
 	return result;
 }
-- 
2.1.0.rc0.78.gc0d8480
Previous: Jeff KingNext: Nguyễn Thái Ngọc Duy
Message 6 of 7 in “fetch: convert argv_gc_auto to struct argv_array”
  1. 1/2 fetch: convert argv_gc_auto to struct argv_arrayNguyễn Thái Ngọc Duy, Aug 14, 2014
  2. 2/2 fetch: silence git-gc if --quiet is givenNguyễn Thái Ngọc Duy, Aug 14, 2014
  3. Jeff KingAug 14, 2014
  4. Duy NguyenAug 15, 2014
  5. Jeff KingAug 14, 2014
  6. 1/2 fetch: convert argv_gc_auto to struct argv_arrayNguyễn Thái Ngọc Duy, Aug 16, 2014
  7. 2/2 fetch: silence git-gc if --quiet is givenNguyễn Thái Ngọc Duy, Aug 16, 2014

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.