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

Function credential_ask_one

credential.c:241–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static char *credential_ask_one(const char *what, struct credential *c,
242 int flags)
243{
244 struct strbuf desc = STRBUF_INIT;
245 struct strbuf prompt = STRBUF_INIT;
246 char *r;
247
248 if (c->sanitize_prompt)
249 credential_format(c, &desc);
250 else
251 credential_describe(c, &desc);
252 if (desc.len)
253 strbuf_addf(&prompt, "%s for '%s': ", what, desc.buf);
254 else
255 strbuf_addf(&prompt, "%s: ", what);
256
257 r = git_prompt(prompt.buf, flags);
258
259 strbuf_release(&desc);
260 strbuf_release(&prompt);
261 return xstrdup(r);
262}
263
264static int credential_getpass(struct repository *r, struct credential *c)
265{

Callers 1

credential_getpassFunction · 0.85

Calls 6

credential_formatFunction · 0.85
credential_describeFunction · 0.85
strbuf_addfFunction · 0.85
git_promptFunction · 0.85
strbuf_releaseFunction · 0.85
xstrdupFunction · 0.85

Tested by

no test coverage detected