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

Re: [PATCH] Correct handling of upload-pack in builtin-fetch-pack

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 30, 2007, 02:41 UTC
Message-ID
<20071030024123.GW14735@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0710292232330.7357@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 7 quoted lines
> The field in the args was being ignored in favor of a static constant
> 
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
> Found this while trying to figure out how builtin-fetch-pack was 
> initializing the string in the args struct, and why it generally worked 
> even though it wasn't.
Gahhh.  Yes, obviously correct fix.  Thanks!  :-)
 
Show 20 quoted lines
> -static struct fetch_pack_args args;
> +static struct fetch_pack_args args = {
> +	/* .uploadpack = */ "git-upload-pack",
> +};
>  
>  static const char fetch_pack_usage[] =
>  "git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
> -static const char *uploadpack = "git-upload-pack";
>  
>  #define COMPLETE	(1U << 0)
>  #define COMMON		(1U << 1)
> @@ -773,7 +774,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
>  			st.st_mtime = 0;
>  	}
>  
> -	pid = git_connect(fd, (char *)dest, uploadpack,
> +	pid = git_connect(fd, (char *)dest, args.uploadpack,
>                            args.verbose ? CONNECT_VERBOSE : 0);
>  	if (pid < 0)
>  		return NULL;
-- 
Shawn.
Previous: Daniel Barkalow
Message 2 of 2 in “Correct handling of upload-pack in builtin-fetch-pack”
  1. Correct handling of upload-pack in builtin-fetch-packDaniel Barkalow, Oct 30, 2007
  2. Shawn O. PearceOct 30, 2007

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.