Merge branch 'rs/grep-p'
[gitweb.git] / builtin-add.c
index bee45f00de7d82e07b617716033f0d5605b2a368..78989dad8cb07dee00054c3ea98d16eb493a05c9 100644 (file)
@@ -189,7 +189,7 @@ int interactive_add(int argc, const char **argv, const char *prefix)
        return status;
 }
 
-int edit_patch(int argc, const char **argv, const char *prefix)
+static int edit_patch(int argc, const char **argv, const char *prefix)
 {
        char *file = xstrdup(git_path("ADD_EDIT.patch"));
        const char *apply_argv[] = { "apply", "--recount", "--cached",
@@ -220,7 +220,7 @@ int edit_patch(int argc, const char **argv, const char *prefix)
        launch_editor(file, NULL, NULL);
 
        if (stat(file, &st))
-               die("Could not stat '%s'", file);
+               die_errno("Could not stat '%s'", file);
        if (!st.st_size)
                die("Empty patch. Aborted.");
 
@@ -298,15 +298,15 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        int add_new_files;
        int require_pathspec;
 
-       argc = parse_options(argc, argv, builtin_add_options,
+       git_config(add_config, NULL);
+
+       argc = parse_options(argc, argv, prefix, builtin_add_options,
                          builtin_add_usage, PARSE_OPT_KEEP_ARGV0);
        if (patch_interactive)
                add_interactive = 1;
        if (add_interactive)
                exit(interactive_add(argc - 1, argv + 1, prefix));
 
-       git_config(add_config, NULL);
-
        if (edit_interactive)
                return(edit_patch(argc, argv, prefix));
        argc--;