| 912 | } |
| 913 | |
| 914 | static int grep_directory(struct grep_opt *opt, const struct pathspec *pathspec, |
| 915 | int exc_std, int use_index) |
| 916 | { |
| 917 | struct dir_struct dir = DIR_INIT; |
| 918 | int i, hit = 0; |
| 919 | |
| 920 | if (!use_index) |
| 921 | dir.flags |= DIR_NO_GITLINKS; |
| 922 | if (exc_std) |
| 923 | setup_standard_excludes(&dir); |
| 924 | |
| 925 | fill_directory(&dir, opt->repo->index, pathspec); |
| 926 | for (i = 0; i < dir.nr; i++) { |
| 927 | hit |= grep_file(opt, dir.entries[i]->name); |
| 928 | if (hit && opt->status_only) |
| 929 | break; |
| 930 | } |
| 931 | dir_clear(&dir); |
| 932 | return hit; |
| 933 | } |
| 934 | |
| 935 | static int context_callback(const struct option *opt, const char *arg, |
| 936 | int unset) |
no test coverage detected