X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=receive-pack.c;h=2a3db16d684e3d7ec9bbdd5f80266eb1e4af6f64;hb=7465ef5155cec830a34dcffdd8272d4beb243220;hp=e79de917b542eb35d6b5752837b25ccae897646e;hpb=cfee10a773be0f8d0024f2567164c910d4213244;p=git.git diff --git a/receive-pack.c b/receive-pack.c index e79de917..2a3db16d 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -6,7 +6,7 @@ static const char receive_pack_usage[] = "git-receive-pack "; -static const char unpacker[] = "git-unpack-objects"; +static char *unpacker[] = { "unpack-objects", NULL }; static int report_status = 0; @@ -37,7 +37,7 @@ struct command { const char *error_string; unsigned char old_sha1[20]; unsigned char new_sha1[20]; - char ref_name[0]; + char ref_name[FLEX_ARRAY]; /* more */ }; static struct command *commands = NULL; @@ -92,7 +92,7 @@ static int run_update_hook(const char *refname, case -ERR_RUN_COMMAND_WAITPID_WRONG_PID: return error("waitpid is confused"); case -ERR_RUN_COMMAND_WAITPID_SIGNAL: - return error("%s died of signal\n", update_hook); + return error("%s died of signal", update_hook); case -ERR_RUN_COMMAND_WAITPID_NOEXIT: return error("%s died strangely", update_hook); default: @@ -158,7 +158,7 @@ static int update(struct command *cmd) if (run_update_hook(name, old_hex, new_hex)) { unlink(lock_name); cmd->error_string = "hook declined"; - return error("hook declined to update %s\n", name); + return error("hook declined to update %s", name); } else if (rename(lock_name, name) < 0) { unlink(lock_name); @@ -257,7 +257,7 @@ static void read_head_info(void) static const char *unpack(int *error_code) { - int code = run_command(unpacker, NULL); + int code = run_command_v_opt(1, unpacker, RUN_GIT_CMD); *error_code = 0; switch (code) {