summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f3eceb)
raw | patch | inline | side by side (parent: 7f3eceb)
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | |
Wed, 17 Nov 2010 17:15:34 +0000 (09:15 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 19 Nov 2010 19:04:20 +0000 (11:04 -0800) |
When compiling with pthread support, transport-helper.c needs to include
necessary header files. Also fix a few error messages in remote-ext and
remote-fd programs, and a potential buffer underrun in remote-fd.
In the documentation, clarify how %G and %V are used; the old description
looked as if they take repository/vhost parameters, which was wrong.
Also fix AsciiDoc markup for the page title of remote-fd/remote-ext manpages,
and tweak the way how section headers are shown.
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
necessary header files. Also fix a few error messages in remote-ext and
remote-fd programs, and a potential buffer underrun in remote-fd.
In the documentation, clarify how %G and %V are used; the old description
looked as if they take repository/vhost parameters, which was wrong.
Also fix AsciiDoc markup for the page title of remote-fd/remote-ext manpages,
and tweak the way how section headers are shown.
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
index 8fb260b54b072bfd79ebf037967173994f0f2c5f..f4fbf672094ed11acb5ca551b5cc411a86f3f1ba 100644 (file)
git-upload-pack, or git-upload-archive) of the service
git wants to invoke.
-'%G<repository>' (as argument)::
+'%G' (must be first characters in 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
+ repository field set to rest of the argument. Default is not to send
such request.
+
This is useful if remote side is git:// server accessed over
some tunnel.
-'%V<host>' (as argument)::
+'%V' (must be first characters in 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 vhost field in git:// service request (to rest of the argument).
+ Default is not to send vhost in such request (if sent).
ENVIRONMENT VARIABLES:
----------------------
index 1c1a1795c71f5da78d519ae42e00293b31e24ac1..abc49441be7a86e25a2b09d98f7de2ddcf0b0bb2 100644 (file)
git-remote-fd(1)
-=================
+================
NAME
----
information to user in the URL in case that URL is displayed in some
context.
-ENVIRONMENT VARIABLES:
-----------------------
+ENVIRONMENT VARIABLES
+---------------------
GIT_TRANSLOOP_DEBUG::
If set, prints debugging information about various reads/writes.
-EXAMPLES:
----------
+EXAMPLES
+--------
git fetch fd::17 master::
Fetch master, using file descriptor #17 to communicate with
git-upload-pack.
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 1d3f1cf3cc4854b4c136c5db034baabf1889e3ce..1f773171cbdde76cc105e37928cc5f2ecb2ed93f 100644 (file)
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
for (i = 0; i < arguments; i++)
ret[i] = temparray[i];
ret[arguments] = NULL;
- return (const char **)ret;
+ return ret;
}
static void send_git_request(int stdin_fd, const char *serv, const char *repo,
int cmd_remote_ext(int argc, const char **argv, const char *prefix)
{
- if (argc < 3) {
- fprintf(stderr, "Error: URL missing");
- exit(1);
- }
+ if (argc != 3)
+ die("Expected two arguments");
return command_loop(argv[2]);
}
diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c
index 7517f2476cb04eea5b5568f8f562a6cc1167d221..1f2467bdb756435764f9156ffefeeb510dc872d8 100644 (file)
--- a/builtin/remote-fd.c
+++ b/builtin/remote-fd.c
}
/* Strip end of line characters. */
i = strlen(buffer);
- while (isspace(buffer[i - 1]))
+ while (i > 0 && isspace(buffer[i - 1]))
buffer[--i] = 0;
if (!strcmp(buffer, "capabilities")) {
int output_fd = -1;
char *end;
- if (argc < 3)
- die("URL missing");
+ if (argc != 3)
+ die("Expected two arguments");
input_fd = (int)strtoul(argv[2], &end, 10);
diff --git a/transport-helper.c b/transport-helper.c
index 0c094d66c1e39423b9c0765c7690113b685c6cdc..3a50856318798c14824bb628d7d463cd61b77213 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
#include "remote.h"
#include "string-list.h"
+#ifndef NO_PTHREADS
+#include <pthread.h>
+#include "thread-utils.h"
+#endif
+
static int debug;
struct helper_data