| 482 | } |
| 483 | |
| 484 | static int credential_do(struct credential *c, const char *helper, |
| 485 | const char *operation) |
| 486 | { |
| 487 | struct strbuf cmd = STRBUF_INIT; |
| 488 | int r; |
| 489 | |
| 490 | if (helper[0] == '!') |
| 491 | strbuf_addstr(&cmd, helper + 1); |
| 492 | else if (is_absolute_path(helper)) |
| 493 | strbuf_addstr(&cmd, helper); |
| 494 | else |
| 495 | strbuf_addf(&cmd, "git credential-%s", helper); |
| 496 | |
| 497 | strbuf_addf(&cmd, " %s", operation); |
| 498 | r = run_credential_helper(c, cmd.buf, !strcmp(operation, "get")); |
| 499 | |
| 500 | strbuf_release(&cmd); |
| 501 | return r; |
| 502 | } |
| 503 | |
| 504 | void credential_fill(struct repository *r, |
| 505 | struct credential *c, int all_capabilities) |
no test coverage detected