]> git.scripts.mit.edu Git - git.git/blobdiff - git.c
git-config: always treat --int as 64-bit internally
[git.git] / git.c
diff --git a/git.c b/git.c
index 88eef5a7cc6d36f6e17f4855945116dd6f1b0681..2025f77d0181ba646e3c793a693e5d71348b966c 100644 (file)
--- a/git.c
+++ b/git.c
@@ -324,6 +324,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "cat-file", cmd_cat_file, RUN_SETUP },
                { "check-attr", cmd_check_attr, RUN_SETUP },
                { "check-ignore", cmd_check_ignore, RUN_SETUP | NEED_WORK_TREE },
+               { "check-mailmap", cmd_check_mailmap, RUN_SETUP },
                { "check-ref-format", cmd_check_ref_format },
                { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
                { "checkout-index", cmd_checkout_index,
@@ -514,8 +515,9 @@ static int run_argv(int *argcp, const char ***argv)
 }
 
 
-int main(int argc, const char **argv)
+int main(int argc, char **av)
 {
+       const char **argv = (const char **) av;
        const char *cmd;
 
        startup_info = &git_startup_info;
@@ -524,6 +526,13 @@ int main(int argc, const char **argv)
        if (!cmd)
                cmd = "git-help";
 
+       /*
+        * Always open file descriptors 0/1/2 to avoid clobbering files
+        * in die().  It also avoids messing up when the pipes are dup'ed
+        * onto stdin/stdout/stderr in the child processes we spawn.
+        */
+       sanitize_stdfds();
+
        git_setup_gettext();
 
        /*