MCPcopy Create free account
hub / github.com/git/git / do_cache

Function do_cache

builtin/credential-cache.c:96–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static void do_cache(const char *socket, const char *action, int timeout,
97 int flags)
98{
99 struct strbuf buf = STRBUF_INIT;
100
101 strbuf_addf(&buf, "action=%s\n", action);
102 strbuf_addf(&buf, "timeout=%d\n", timeout);
103 if (flags & FLAG_RELAY) {
104 if (strbuf_read(&buf, 0, 0) < 0)
105 die_errno("unable to relay credential");
106 }
107
108 if (send_request(socket, &buf) < 0) {
109 if (connection_fatally_broken(errno))
110 die_errno("unable to connect to cache daemon");
111 if (flags & FLAG_SPAWN) {
112 spawn_daemon(socket);
113 if (send_request(socket, &buf) < 0)
114 die_errno("unable to connect to cache daemon");
115 }
116 }
117 strbuf_release(&buf);
118}
119
120static char *get_socket_path(void)
121{

Callers 1

cmd_credential_cacheFunction · 0.85

Calls 7

strbuf_addfFunction · 0.85
strbuf_readFunction · 0.85
die_errnoFunction · 0.85
strbuf_releaseFunction · 0.85
send_requestFunction · 0.70
spawn_daemonFunction · 0.70

Tested by

no test coverage detected