Merge branch 'rs/child-process-init'
[gitweb.git] / builtin / commit.c
index 36e3a2eef2b65e1e9977fd66e5bd514e492c3e56..ec0048e8b05d5a54e1507b9a8f3e73f06be0fa39 100644 (file)
@@ -1540,7 +1540,7 @@ static int run_rewrite_hook(const unsigned char *oldsha1,
 {
        /* oldsha1 SP newsha1 LF NUL */
        static char buf[2*40 + 3];
-       struct child_process proc;
+       struct child_process proc = CHILD_PROCESS_INIT;
        const char *argv[3];
        int code;
        size_t n;
@@ -1552,7 +1552,6 @@ static int run_rewrite_hook(const unsigned char *oldsha1,
        argv[1] = "amend";
        argv[2] = NULL;
 
-       memset(&proc, 0, sizeof(proc));
        proc.argv = argv;
        proc.in = -1;
        proc.stdout_to_stderr = 1;