{"thread":{"id":"10520","subject":"[PATCH] Correct handling of upload-pack in builtin-fetch-pack","startedAt":"2007-10-30T02:35:08Z","lastAt":"2007-10-30T02:41:23Z","messageCount":2,"participants":["Daniel Barkalow","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"57513","messageId":"Pine.LNX.4.64.0710292232330.7357@iabervon.org","threadId":"10520","inReplyTo":null,"subject":"[PATCH] Correct handling of upload-pack in builtin-fetch-pack","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-10-30T02:35:08Z","receivedAt":"2007-10-30T02:35:08Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"The field in the args was being ignored in favor of a static constant\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nFound this while trying to figure out how builtin-fetch-pack was \ninitializing the string in the args struct, and why it generally worked \neven though it wasn't.\n\n builtin-fetch-pack.c |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 8f25d50..8753840 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -11,11 +11,12 @@\n static int transfer_unpack_limit = -1;\n static int fetch_unpack_limit = -1;\n static int unpack_limit = 100;\n-static struct fetch_pack_args args;\n+static struct fetch_pack_args args = {\n+\t/* .uploadpack = */ \"git-upload-pack\",\n+};\n \n static const char fetch_pack_usage[] =\n \"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]\";\n-static const char *uploadpack = \"git-upload-pack\";\n \n #define COMPLETE\t(1U << 0)\n #define COMMON\t\t(1U << 1)\n@@ -773,7 +774,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,\n \t\t\tst.st_mtime = 0;\n \t}\n \n-\tpid = git_connect(fd, (char *)dest, uploadpack,\n+\tpid = git_connect(fd, (char *)dest, args.uploadpack,\n                           args.verbose ? CONNECT_VERBOSE : 0);\n \tif (pid < 0)\n \t\treturn NULL;\n-- \n1.5.3.4.1206.g5f96\n"},{"id":"57514","messageId":"20071030024123.GW14735@spearce.org","threadId":"10520","inReplyTo":"Pine.LNX.4.64.0710292232330.7357@iabervon.org","subject":"Re: [PATCH] Correct handling of upload-pack in builtin-fetch-pack","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-30T02:41:23Z","receivedAt":"2007-10-30T02:41:23Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> wrote:\n> The field in the args was being ignored in favor of a static constant\n> \n> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> ---\n> Found this while trying to figure out how builtin-fetch-pack was \n> initializing the string in the args struct, and why it generally worked \n> even though it wasn't.\n\nGahhh.  Yes, obviously correct fix.  Thanks!  :-)\n \n> -static struct fetch_pack_args args;\n> +static struct fetch_pack_args args = {\n> +\t/* .uploadpack = */ \"git-upload-pack\",\n> +};\n>  \n>  static const char fetch_pack_usage[] =\n>  \"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]\";\n> -static const char *uploadpack = \"git-upload-pack\";\n>  \n>  #define COMPLETE\t(1U << 0)\n>  #define COMMON\t\t(1U << 1)\n> @@ -773,7 +774,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,\n>  \t\t\tst.st_mtime = 0;\n>  \t}\n>  \n> -\tpid = git_connect(fd, (char *)dest, uploadpack,\n> +\tpid = git_connect(fd, (char *)dest, args.uploadpack,\n>                            args.verbose ? CONNECT_VERBOSE : 0);\n>  \tif (pid < 0)\n>  \t\treturn NULL;\n\n-- \nShawn.\n"}]}