| 239 | } |
| 240 | |
| 241 | static 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 | |
| 264 | static int credential_getpass(struct repository *r, struct credential *c) |
| 265 | { |
no test coverage detected