]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/add.c
run-command: introduce CHILD_PROCESS_INIT
[thirdparty/git.git] / builtin / add.c
index 4baf3a563510b10e592ff06ae62df2f405413f6c..352b85e8db19e1b4fa05ca37804f0c625e582912 100644 (file)
@@ -180,7 +180,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
        char *file = git_pathdup("ADD_EDIT.patch");
        const char *apply_argv[] = { "apply", "--recount", "--cached",
                NULL, NULL };
-       struct child_process child;
+       struct child_process child = CHILD_PROCESS_INIT;
        struct rev_info rev;
        int out;
        struct stat st;
@@ -214,7 +214,6 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
        if (!st.st_size)
                die(_("Empty patch. Aborted."));
 
-       memset(&child, 0, sizeof(child));
        child.git_cmd = 1;
        child.argv = apply_argv;
        if (run_command(&child))