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

[PATCH 1/2] upload-archive: drop extra argument to prepare_argv

From
Jeff King <peff@peff.net>
Date
Nov 15, 2011, 19:46 UTC
Message-ID
<20111115194603.GA19305@sigill.intra.peff.net>
In-Reply-To
<20111115191832.GA16030@sigill.intra.peff.net>

We pass a "sent_argv" which is an out-parameter to hold the argv that we were sent over the wire. But we also pass in the "argv" we got on the command line, which is not used at all. Drop this useless and confusing parameter.

The parameter was obsoleted by c09cd77e, which moved the enter_repo function (which looked at argv[1]) out of prepare_argv and into cmd_upload_archive.

Signed-off-by: Jeff King <peff@peff.net>
---
On Tue, Nov 15, 2011 at 02:18:32PM -0500, Jeff King wrote:
> > Let's just do "static" for now, if we know the array is large enough.
> 
> OK, here it is.

And here's the other more invasive cleanup on top (patch 2 is the meaty one).

 builtin/upload-archive.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index f47c0f0..80575b9 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -19,7 +19,7 @@
 
 #define MAX_ARGS (64)
 
-static void prepare_argv(const char **sent_argv, const char **argv)
+static void prepare_argv(const char **sent_argv)
 {
 	const char *arg_cmd = "argument ";
 	char *p;
@@ -95,7 +95,7 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
 	if (!enter_repo(argv[1], 0))
 		die("'%s' does not appear to be a git repository", argv[1]);
 
-	prepare_argv(sent_argv, argv);
+	prepare_argv(sent_argv);
 	if (start_command(&cld)) {
 		int err = errno;
 		packet_write(1, "NACK fork failed on the remote side\n");
-- 
1.7.7.3.8.g38efa
Previous: Jeff KingNext: Jeff King
Message 14 of 17 in “port upload-archive to Windows”
  1. 0/3 port upload-archive to WindowsErik Faye-Lund, Oct 24, 2011
  2. 1/3 mingw: move poll out of sys-folderErik Faye-Lund, Oct 24, 2011
  3. 2/3 compat/win32/poll.c: upgrade from upstreamErik Faye-Lund, Oct 24, 2011
  4. 3/3 upload-archive: use start_command instead of forkErik Faye-Lund, Oct 24, 2011
  5. Jeff KingOct 24, 2011
  6. Thomas RastNov 15, 2011
  7. Jeff KingNov 15, 2011
  8. Thomas RastNov 15, 2011
  9. Jeff KingNov 15, 2011
  10. Erik Faye-LundNov 15, 2011
  11. Jeff KingNov 15, 2011
  12. Junio C HamanoNov 15, 2011
  13. Jeff KingNov 15, 2011
  14. 1/2 upload-archive: drop extra argument to prepare_argvJeff King, Nov 15, 2011
  15. upload-archive: use argv_array for sent parametersJeff King, Nov 15, 2011
  16. Jeff KingNov 15, 2011
  17. Andreas SchwabNov 15, 2011

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.