MCPcopy Index your code
hub / github.com/git/git / notes_rewrite_config

Function notes_rewrite_config

notes-utils.c:103–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static int notes_rewrite_config(const char *k, const char *v,
104 const struct config_context *ctx UNUSED,
105 void *cb)
106{
107 struct notes_rewrite_cfg *c = cb;
108 if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) {
109 c->enabled = git_config_bool(k, v);
110 return 0;
111 } else if (!c->mode_from_env && !strcmp(k, "notes.rewritemode")) {
112 if (!v)
113 return config_error_nonbool(k);
114 c->combine = parse_combine_notes_fn(v);
115 if (!c->combine) {
116 error(_("Bad notes.rewriteMode value: '%s'"), v);
117 return 1;
118 }
119 return 0;
120 } else if (!c->refs_from_env && !strcmp(k, "notes.rewriteref")) {
121 if (!v)
122 return config_error_nonbool(k);
123 /* note that a refs/ prefix is implied in the
124 * underlying for_each_glob_ref */
125 if (starts_with(v, "refs/notes/"))
126 string_list_add_refs_by_glob(c->refs, v);
127 else
128 warning(_("Refusing to rewrite notes in %s"
129 " (outside of refs/notes/)"), v);
130 return 0;
131 }
132
133 return 0;
134}
135
136
137struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)

Callers

nothing calls this directly

Calls 7

starts_withFunction · 0.85
git_config_boolFunction · 0.85
config_error_nonboolFunction · 0.85
parse_combine_notes_fnFunction · 0.85
errorFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected