Merge branch 'jc/commit-is-spelled-with-two-ems'
[gitweb.git] / builtin / check-ignore.c
index d49c083525741350400929c7d3919126058da327..e2a1cef6843b7db2f7ffb4b9c89003397948c748 100644 (file)
@@ -12,18 +12,18 @@ static const char * const check_ignore_usage[] = {
 NULL
 };
 
-static int null_term_line;
+static int nul_term_line;
 
 static const struct option check_ignore_options[] = {
        OPT__QUIET(&quiet, N_("suppress progress reporting")),
        OPT__VERBOSE(&verbose, N_("be verbose")),
        OPT_GROUP(""),
-       OPT_BOOLEAN(0, "stdin", &stdin_paths,
-                   N_("read file names from stdin")),
-       OPT_BOOLEAN('z', NULL, &null_term_line,
-                   N_("input paths are terminated by a null character")),
-       OPT_BOOLEAN('n', "non-matching", &show_non_matching,
-                   N_("show non-matching input paths")),
+       OPT_BOOL(0, "stdin", &stdin_paths,
+                N_("read file names from stdin")),
+       OPT_BOOL('z', NULL, &nul_term_line,
+                N_("terminate input and output records by a NUL character")),
+       OPT_BOOL('n', "non-matching", &show_non_matching,
+                N_("show non-matching input paths")),
        OPT_END()
 };
 
@@ -31,7 +31,7 @@ static void output_exclude(const char *path, struct exclude *exclude)
 {
        char *bang  = (exclude && exclude->flags & EXC_FLAG_NEGATIVE)  ? "!" : "";
        char *slash = (exclude && exclude->flags & EXC_FLAG_MUSTBEDIR) ? "/" : "";
-       if (!null_term_line) {
+       if (!nul_term_line) {
                if (!verbose) {
                        write_name_quoted(path, stdout, '\n');
                } else {
@@ -94,9 +94,9 @@ static int check_ignore(struct dir_struct *dir,
         * should not be ignored, in order to be consistent with
         * 'git status', 'git add' etc.
         */
-       seen = find_pathspecs_matching_against_index(pathspec.raw);
+       seen = find_pathspecs_matching_against_index(&pathspec);
        for (i = 0; i < pathspec.nr; i++) {
-               full_path = pathspec.raw[i];
+               full_path = pathspec.items[i].match;
                exclude = NULL;
                if (!seen[i]) {
                        exclude = last_exclude_matching(dir, full_path, &dtype);
@@ -115,7 +115,7 @@ static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)
 {
        struct strbuf buf, nbuf;
        char *pathspec[2] = { NULL, NULL };
-       int line_termination = null_term_line ? 0 : '\n';
+       int line_termination = nul_term_line ? 0 : '\n';
        int num_ignored = 0;
 
        strbuf_init(&buf, 0);
@@ -151,7 +151,7 @@ int cmd_check_ignore(int argc, const char **argv, const char *prefix)
                if (argc > 0)
                        die(_("cannot specify pathnames with --stdin"));
        } else {
-               if (null_term_line)
+               if (nul_term_line)
                        die(_("-z only makes sense with --stdin"));
                if (argc == 0)
                        die(_("no path specified"));