Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
upload-pack: use argv_array for pack_objects
author
Michael Procter
<michael@procter.org.uk>
Thu, 25 Feb 2016 12:13:26 +0000
(12:13 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 25 Feb 2016 22:20:25 +0000
(14:20 -0800)
Use the argv_array in the child_process structure, to avoid having to
manually maintain an array size.
Signed-off-by: Michael Procter <michael@procter.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
326e5bc
)
diff --git
a/upload-pack.c
b/upload-pack.c
index b3f6653ffda1a3d6d319752676511307d9cd032b..dc802a07c2225463c2e4ee923b9cf144d57a00cc 100644
(file)
--- a/
upload-pack.c
+++ b/
upload-pack.c
@@
-90,35
+90,32
@@
static void create_pack_file(void)
"corruption on the remote side.";
int buffered = -1;
ssize_t sz;
"corruption on the remote side.";
int buffered = -1;
ssize_t sz;
- const char *argv[13];
- int i, arg = 0;
+ int i;
FILE *pipe_fd;
if (shallow_nr) {
FILE *pipe_fd;
if (shallow_nr) {
- argv
[arg++] = "--shallow-file"
;
- argv
[arg++] = ""
;
+ argv
_array_push(&pack_objects.args, "--shallow-file")
;
+ argv
_array_push(&pack_objects.args, "")
;
}
}
- argv
[arg++] = "pack-objects"
;
- argv
[arg++] = "--revs"
;
+ argv
_array_push(&pack_objects.args, "pack-objects")
;
+ 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[arg++] = NULL;
+ argv_array_push(&pack_objects.args, "--include-tag");
pack_objects.in = -1;
pack_objects.out = -1;
pack_objects.err = -1;
pack_objects.git_cmd = 1;
pack_objects.in = -1;
pack_objects.out = -1;
pack_objects.err = -1;
pack_objects.git_cmd = 1;
- pack_objects.argv = argv;
if (start_command(&pack_objects))
die("git upload-pack: unable to fork git-pack-objects");
if (start_command(&pack_objects))
die("git upload-pack: unable to fork git-pack-objects");