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

Function add_unset_auto_comment_char_advice

config.c:2160–2180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2158}
2159
2160static void add_unset_auto_comment_char_advice(struct repository *repo,
2161 struct comment_char_config *config)
2162{
2163 struct strbuf buf = STRBUF_INIT;
2164
2165 if (!can_unset_comment_char_config(config))
2166 return;
2167
2168 for (size_t i = 0; i < config->nr; i++) {
2169 struct comment_char_config_item *item = &config->item[i];
2170
2171 strbuf_addstr(&buf, " git config unset ");
2172 add_config_scope_arg(repo, &buf, item);
2173 if (get_comment_key_flags(config, item->path, item->key_id) == KEY_SEEN_TWICE)
2174 strbuf_addstr(&buf, "--all ");
2175 strbuf_addf(&buf, "%s\n", comment_key_name(item->key_id));
2176 }
2177 advise(_("\nTo use the default comment string (#) please run\n\n%s"),
2178 buf.buf);
2179 strbuf_release(&buf);
2180}
2181
2182static void add_comment_char_advice(struct repository *repo,
2183 struct comment_char_config *config)

Callers 1

add_comment_char_adviceFunction · 0.85

Calls 8

strbuf_addstrFunction · 0.85
add_config_scope_argFunction · 0.85
get_comment_key_flagsFunction · 0.85
strbuf_addfFunction · 0.85
comment_key_nameFunction · 0.85
adviseFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected