Code

Two small typofixes.
[git.git] / receive-pack.c
index 1a141dc1e55aef221312b4cde590fac865546c43..c176d8fd008ad858a1e60e19e7bf3ea14d735eb5 100644 (file)
@@ -6,12 +6,11 @@
 #include "exec_cmd.h"
 #include "commit.h"
 #include "object.h"
-#include <sys/wait.h>
 
 static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
 
 static int deny_non_fast_forwards = 0;
-static int unpack_limit = 5000;
+static int unpack_limit = 100;
 static int report_status;
 
 static char capabilities[] = " report-status delete-refs ";
@@ -74,7 +73,9 @@ static int run_update_hook(const char *refname,
 
        if (access(update_hook, X_OK) < 0)
                return 0;
-       code = run_command(update_hook, refname, old_hex, new_hex, NULL);
+       code = run_command_opt(RUN_COMMAND_NO_STDIN
+               | RUN_COMMAND_STDOUT_TO_STDERR,
+               update_hook, refname, old_hex, new_hex, NULL);
        switch (code) {
        case 0:
                return 0;
@@ -120,7 +121,8 @@ static int update(struct command *cmd)
                             "but I can't find it!", new_hex);
        }
        if (deny_non_fast_forwards && !is_null_sha1(new_sha1) &&
-           !is_null_sha1(old_sha1)) {
+           !is_null_sha1(old_sha1) &&
+           !strncmp(name, "refs/heads/", 11)) {
                struct commit *old_commit, *new_commit;
                struct commit_list *bases, *ent;
 
@@ -187,7 +189,8 @@ 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_STDIN
+               | RUN_COMMAND_STDOUT_TO_STDERR);
 }
 
 /*
@@ -283,7 +286,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;
@@ -419,6 +422,8 @@ int main(int argc, char **argv)
                die("'%s': unable to chdir or not a git archive", dir);
 
        setup_ident();
+       /* don't die if gecos is empty */
+       ignore_missing_committer_name();
        git_config(receive_pack_config);
 
        write_head_info();