fast-import.c: replace `git_config()` with `git_config_get_*()` family
[gitweb.git] / builtin / receive-pack.c
index 145105068999634a43d172b31d5a6c8dc7d12572..92561bffc1ea4ba11d3fd45aa3e216edda3461f7 100644 (file)
@@ -614,12 +614,9 @@ static void run_update_post_hook(struct command *commands)
        argv[0] = hook;
 
        for (argc = 1, cmd = commands; cmd; cmd = cmd->next) {
-               char *p;
                if (cmd->error_string || cmd->did_not_exist)
                        continue;
-               p = xmalloc(strlen(cmd->ref_name) + 1);
-               strcpy(p, cmd->ref_name);
-               argv[argc] = p;
+               argv[argc] = xstrdup(cmd->ref_name);
                argc++;
        }
        argv[argc] = NULL;