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

Function add_patterns_from_file_1

dir.c:1306–1320  ·  view source on GitHub ↗

* Used to set up core.excludesfile and .git/info/exclude lists. */

Source from the content-addressed store, hash-verified

1304 * Used to set up core.excludesfile and .git/info/exclude lists.
1305 */
1306static void add_patterns_from_file_1(struct dir_struct *dir, const char *fname,
1307 struct oid_stat *oid_stat)
1308{
1309 struct pattern_list *pl;
1310 /*
1311 * catch setup_standard_excludes() that's called before
1312 * dir->untracked is assigned. That function behaves
1313 * differently when dir->untracked is non-NULL.
1314 */
1315 if (!dir->untracked)
1316 dir->internal.unmanaged_exclude_files++;
1317 pl = add_pattern_list(dir, EXC_FILE, fname);
1318 if (add_patterns(fname, "", 0, pl, NULL, 0, oid_stat) < 0)
1319 die(_("cannot use %s as an exclude file"), fname);
1320}
1321
1322void add_patterns_from_file(struct dir_struct *dir, const char *fname)
1323{

Callers 2

add_patterns_from_fileFunction · 0.85
setup_standard_excludesFunction · 0.85

Calls 3

add_pattern_listFunction · 0.85
add_patternsFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected