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

Function remote_exists

http-push.c:1539–1560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1537}
1538
1539static int remote_exists(const char *path)
1540{
1541 char *url = xstrfmt("%s%s", repo->url, path);
1542 int ret;
1543
1544
1545 switch (http_get_strbuf(url, NULL, NULL)) {
1546 case HTTP_OK:
1547 ret = 1;
1548 break;
1549 case HTTP_MISSING_TARGET:
1550 ret = 0;
1551 break;
1552 case HTTP_ERROR:
1553 error("unable to access '%s': %s", url, curl_errorstr);
1554 /* fallthrough */
1555 default:
1556 ret = -1;
1557 }
1558 free(url);
1559 return ret;
1560}
1561
1562static void fetch_symref(const char *path, char **symref, struct object_id *oid)
1563{

Callers 1

cmd_mainFunction · 0.85

Calls 3

xstrfmtFunction · 0.85
http_get_strbufFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected