Merge branch 'mp/upload-pack-use-embedded-args' into maint
The embedded args argv-array in the child process is used to build the command line to run pack-objects instead of using a separate array of strings. * mp/upload-pack-use-embedded-args: upload-pack: use argv_array for pack_objects
This commit is contained in:
@ -90,35 +90,32 @@ static void create_pack_file(void)
|
|||||||
"corruption on the remote side.";
|
"corruption on the remote side.";
|
||||||
int buffered = -1;
|
int buffered = -1;
|
||||||
ssize_t sz;
|
ssize_t sz;
|
||||||
const char *argv[13];
|
int i;
|
||||||
int i, arg = 0;
|
|
||||||
FILE *pipe_fd;
|
FILE *pipe_fd;
|
||||||
|
|
||||||
if (shallow_nr) {
|
if (shallow_nr) {
|
||||||
argv[arg++] = "--shallow-file";
|
argv_array_push(&pack_objects.args, "--shallow-file");
|
||||||
argv[arg++] = "";
|
argv_array_push(&pack_objects.args, "");
|
||||||
}
|
}
|
||||||
argv[arg++] = "pack-objects";
|
argv_array_push(&pack_objects.args, "pack-objects");
|
||||||
argv[arg++] = "--revs";
|
argv_array_push(&pack_objects.args, "--revs");
|
||||||
if (use_thin_pack)
|
if (use_thin_pack)
|
||||||
argv[arg++] = "--thin";
|
argv_array_push(&pack_objects.args, "--thin");
|
||||||
|
|
||||||
argv[arg++] = "--stdout";
|
argv_array_push(&pack_objects.args, "--stdout");
|
||||||
if (shallow_nr)
|
if (shallow_nr)
|
||||||
argv[arg++] = "--shallow";
|
argv_array_push(&pack_objects.args, "--shallow");
|
||||||
if (!no_progress)
|
if (!no_progress)
|
||||||
argv[arg++] = "--progress";
|
argv_array_push(&pack_objects.args, "--progress");
|
||||||
if (use_ofs_delta)
|
if (use_ofs_delta)
|
||||||
argv[arg++] = "--delta-base-offset";
|
argv_array_push(&pack_objects.args, "--delta-base-offset");
|
||||||
if (use_include_tag)
|
if (use_include_tag)
|
||||||
argv[arg++] = "--include-tag";
|
argv_array_push(&pack_objects.args, "--include-tag");
|
||||||
argv[arg++] = NULL;
|
|
||||||
|
|
||||||
pack_objects.in = -1;
|
pack_objects.in = -1;
|
||||||
pack_objects.out = -1;
|
pack_objects.out = -1;
|
||||||
pack_objects.err = -1;
|
pack_objects.err = -1;
|
||||||
pack_objects.git_cmd = 1;
|
pack_objects.git_cmd = 1;
|
||||||
pack_objects.argv = argv;
|
|
||||||
|
|
||||||
if (start_command(&pack_objects))
|
if (start_command(&pack_objects))
|
||||||
die("git upload-pack: unable to fork git-pack-objects");
|
die("git upload-pack: unable to fork git-pack-objects");
|
||||||
|
Reference in New Issue
Block a user