Re: [RFC PATCH v7 3/3] git-remote-ext
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:47
Ilari Liusvaara [off-list ref] writes:
+'%G<repository>' (as argument):: + This argument will not be passed to 'program'. Instead, it + will cause helper to start by sending git:// service request to + remote side with service field set to approiate value and + repository field set to <repository>. Default is not to send + such request. ++ +This is useful if remote side is git:// server accessed over +some tunnel. + +'%V<host>' (as argument):: + This argument will not be passed to 'program'. Instead it sets + the vhost field in git:// service request. Default is not to + send vhost in such request (if sent).
The above does not say anything about being the first 'character' in an argument, like the in-code comment does. Is that intended?
+static const char **parse_argv(const char *arg, const char *service)
+{
+ int arguments = 0;
+ int i;
+ const char **ret;
+ char *temparray[MAXARGUMENTS + 1];
+
+ while (*arg) {
+ char *expanded;
+ if (arguments == MAXARGUMENTS)
+ die("remote-ext command has too many arguments");
+ expanded = strip_escapes(arg, service, &arg);
+ if (expanded)
+ temparray[arguments++] = expanded;
+ }
+
+ ret = xmalloc((arguments + 1) * sizeof(char *));
+ for (i = 0; i < arguments; i++)
+ ret[i] = temparray[i];
+ ret[arguments] = NULL;
+ return (const char **)ret;
+}Isn't "ret" declared to be of that type?