grep: fix exit status if external_grep() punts
[gitweb.git] / builtin-add.c
index ad889aac5bd174bf96a87b78eeb243aea89a1626..d6ad57bfc2841959a2017d0723c1f9d57a920fac 100644 (file)
@@ -250,6 +250,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        int add_new_files;
        int require_pathspec;
 
+       git_config(add_config, NULL);
+
        argc = parse_options(argc, argv, builtin_add_options,
                          builtin_add_usage, 0);
        if (patch_interactive)
@@ -257,8 +259,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        if (add_interactive)
                exit(interactive_add(argc, argv, prefix));
 
-       git_config(add_config, NULL);
-
        if (addremove && take_worktree_changes)
                die("-A and -u are mutually incompatible");
        if ((addremove || take_worktree_changes) && !argc) {