Remove unnecessary argc parameter from run_command_v.

The argc parameter is never used by the run_command_v family of
functions.  Instead they require that the passed argv[] be NULL
terminated so they can rely on the operating system's execvp
function to correctly pass the arguments to the new process.

Making the caller pass the argc is just confusing, as the caller
could be mislead into believing that the argc might take precendece
over the argv, or that the argv does not need to be NULL terminated.
So goodbye argc.  Don't come back.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Shawn O. Pearce
2006-12-30 21:55:15 -05:00
committed by Junio C Hamano
parent ad1a382fbb
commit 9b0b50936e
4 changed files with 9 additions and 9 deletions

View File

@ -187,7 +187,7 @@ static void run_update_post_hook(struct command *cmd)
argc++;
}
argv[argc] = NULL;
run_command_v_opt(argc, argv, RUN_COMMAND_NO_STDIO);
run_command_v_opt(argv, RUN_COMMAND_NO_STDIO);
}
/*
@ -283,7 +283,7 @@ static const char *unpack(void)
unpacker[0] = "unpack-objects";
unpacker[1] = hdr_arg;
unpacker[2] = NULL;
code = run_command_v_opt(1, unpacker, RUN_GIT_CMD);
code = run_command_v_opt(unpacker, RUN_GIT_CMD);
switch (code) {
case 0:
return NULL;