#include "builtin.h" #include "transport.h" #include "run-command.h" #include "pkt-line.h" static const char usage_msg[] = …; /* * URL syntax: * 'command [arg1 [arg2 [...]]]' Invoke command with given arguments. * Special characters: * '% ': Literal space in argument. * '%%': Literal percent sign. * '%S': Name of service (git-upload-pack/git-upload-archive/ * git-receive-pack. * '%s': Same as \s, but with possible git- prefix stripped. * '%G': Only allowed as first 'character' of argument. Do not pass this * Argument to command, instead send this as name of repository * in in-line git://-style request (also activates sending this * style of request). * '%V': Only allowed as first 'character' of argument. Used in * conjunction with '%G': Do not pass this argument to command, * instead send this as vhost in git://-style request (note: does * not activate sending git:// style request). */ static char *git_req; static char *git_req_vhost; static char *strip_escapes(const char *str, const char *service, const char **next) { … } static void parse_argv(struct strvec *out, const char *arg, const char *service) { … } static void send_git_request(int stdin_fd, const char *serv, const char *repo, const char *vhost) { … } static int run_child(const char *arg, const char *service) { … } #define MAXCOMMAND … static int command_loop(const char *child) { … } int cmd_remote_ext(int argc, const char **argv, const char *prefix, struct repository *repo UNUSED) { … }