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

Function credential_format

credential.c:223–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static void credential_format(struct credential *c, struct strbuf *out)
224{
225 if (!c->protocol)
226 return;
227 strbuf_addf(out, "%s://", c->protocol);
228 if (c->username && *c->username) {
229 strbuf_add_percentencode(out, c->username, STRBUF_ENCODE_SLASH);
230 strbuf_addch(out, '@');
231 }
232 if (c->host)
233 strbuf_add_percentencode(out, c->host,
234 STRBUF_ENCODE_HOST_AND_PORT);
235 if (c->path) {
236 strbuf_addch(out, '/');
237 strbuf_add_percentencode(out, c->path, 0);
238 }
239}
240
241static char *credential_ask_one(const char *what, struct credential *c,
242 int flags)

Callers 2

credential_apply_configFunction · 0.85
credential_ask_oneFunction · 0.85

Calls 3

strbuf_addfFunction · 0.85
strbuf_add_percentencodeFunction · 0.85
strbuf_addchFunction · 0.85

Tested by

no test coverage detected