From c09cd77ea2fe3580b33918a99fe138d239ac2aaf Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 24 Oct 2011 18:02:11 +0200 Subject: upload-archive: use start_command instead of fork The POSIX-function fork is not supported on Windows. Use our start_command API instead. As this is the last call-site that depends on the fork-stub in compat/mingw.h, remove that as well. Add an undocumented flag to git-archive that tells it that the action originated from a remote, so features can be disabled. Thanks to Jeff King for work on this part. Remove the NOT_MINGW-prereq for t5000, as git-archive --remote now works. Signed-off-by: Erik Faye-Lund Helped-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/archive.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'builtin/archive.c') diff --git a/builtin/archive.c b/builtin/archive.c index 931956def..e405566c5 100644 --- a/builtin/archive.c +++ b/builtin/archive.c @@ -87,6 +87,7 @@ int cmd_archive(int argc, const char **argv, const char *prefix) const char *exec = "git-upload-archive"; const char *output = NULL; const char *remote = NULL; + int is_remote = 0; struct option local_opts[] = { OPT_STRING('o', "output", &output, "file", "write the archive to this file"), @@ -94,6 +95,9 @@ int cmd_archive(int argc, const char **argv, const char *prefix) "retrieve the archive from remote repository "), OPT_STRING(0, "exec", &exec, "cmd", "path to the remote git-upload-archive command"), + { OPTION_BOOLEAN, 0, "remote-request", &is_remote, NULL, + "indicate we are serving a remote request", + PARSE_OPT_NOARG | PARSE_OPT_HIDDEN }, OPT_END() }; @@ -108,5 +112,5 @@ int cmd_archive(int argc, const char **argv, const char *prefix) setvbuf(stderr, NULL, _IOLBF, BUFSIZ); - return write_archive(argc, argv, prefix, 1, output, 0); + return write_archive(argc, argv, prefix, 1, output, is_remote); } -- cgit v1.2.1