| 1503 | } |
| 1504 | |
| 1505 | char *git_global_config(void) |
| 1506 | { |
| 1507 | char *user_config, *xdg_config; |
| 1508 | |
| 1509 | git_global_config_paths(&user_config, &xdg_config); |
| 1510 | if (!user_config) { |
| 1511 | free(xdg_config); |
| 1512 | return NULL; |
| 1513 | } |
| 1514 | |
| 1515 | if (access_or_warn(user_config, R_OK, 0) && xdg_config && |
| 1516 | !access_or_warn(xdg_config, R_OK, 0)) { |
| 1517 | free(user_config); |
| 1518 | return xdg_config; |
| 1519 | } else { |
| 1520 | free(xdg_config); |
| 1521 | return user_config; |
| 1522 | } |
| 1523 | } |
| 1524 | |
| 1525 | void git_global_config_paths(char **user_out, char **xdg_out) |
| 1526 | { |
no test coverage detected