MCPcopy Create free account
hub / github.com/git/git / grep_directory

Function grep_directory

builtin/grep.c:914–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912}
913
914static 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
935static int context_callback(const struct option *opt, const char *arg,
936 int unset)

Callers 1

cmd_grepFunction · 0.85

Calls 4

setup_standard_excludesFunction · 0.85
fill_directoryFunction · 0.85
grep_fileFunction · 0.85
dir_clearFunction · 0.85

Tested by

no test coverage detected