summaryrefslogtreecommitdiff
path: root/builtin/archive.c
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2011-10-24 18:02:11 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-30 18:45:21 -0700
commitc09cd77ea2fe3580b33918a99fe138d239ac2aaf (patch)
treed55158b903d42f10a2b8a2004081d110ddac364a /builtin/archive.c
parentf0bd664977b25e68c1230a533dd644706cff3ae2 (diff)
downloadgit-c09cd77ea2fe3580b33918a99fe138d239ac2aaf.tar.gz
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 <kusmabite@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/archive.c')
-rw-r--r--builtin/archive.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/archive.c b/builtin/archive.c
index 931956def9..e405566c5e 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 <repo>"),
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);
}