Code

Merge git://github.com/git-l10n/git-po
[git.git] / builtin / grep.c
index 9fc3e95cc610c9df7d2b17eae59ac2c161443982..643938d905fb134a1e65e3684e8e5feb06b01a59 100644 (file)
@@ -265,11 +265,8 @@ static int grep_config(const char *var, const char *value, void *cb)
        struct grep_opt *opt = cb;
        char *color = NULL;
 
-       switch (userdiff_config(var, value)) {
-       case 0: break;
-       case -1: return -1;
-       default: return 0;
-       }
+       if (userdiff_config(var, value) < 0)
+               return -1;
 
        if (!strcmp(var, "grep.extendedregexp")) {
                if (git_config_bool(var, value))
@@ -687,9 +684,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
        struct option options[] = {
                OPT_BOOLEAN(0, "cached", &cached,
                        "search in index instead of in the work tree"),
-               { OPTION_BOOLEAN, 0, "index", &use_index, NULL,
-                       "finds in contents not managed by git",
-                       PARSE_OPT_NOARG | PARSE_OPT_NEGHELP },
+               OPT_NEGBIT(0, "no-index", &use_index,
+                        "finds in contents not managed by git", 1),
                OPT_BOOLEAN(0, "untracked", &untracked,
                        "search in both tracked and untracked files"),
                OPT_SET_INT(0, "exclude-standard", &opt_exclude,