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

Function cmd_credential_cache_daemon

builtin/credential-cache--daemon.c:291–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291int cmd_credential_cache_daemon(int argc,
292 const char **argv,
293 const char *prefix,
294 struct repository *repo UNUSED)
295{
296 struct tempfile *socket_file;
297 const char *socket_path;
298 int ignore_sighup = 0;
299 static const char *usage[] = {
300 "git credential-cache--daemon [--debug] <socket-path>",
301 NULL
302 };
303 int debug = 0;
304 const struct option options[] = {
305 OPT_BOOL(0, "debug", &debug,
306 N_("print debugging messages to stderr")),
307 OPT_END()
308 };
309
310 repo_config_get_bool(the_repository, "credentialcache.ignoresighup", &ignore_sighup);
311
312 argc = parse_options(argc, argv, prefix, options, usage, 0);
313 socket_path = argv[0];
314
315 if (!have_unix_sockets())
316 die(_("credential-cache--daemon unavailable; no unix socket support"));
317 if (!socket_path)
318 usage_with_options(usage, options);
319
320 if (!is_absolute_path(socket_path))
321 die("socket directory must be an absolute path");
322
323 init_socket_directory(socket_path);
324 socket_file = register_tempfile(socket_path);
325
326 if (ignore_sighup)
327 signal(SIGHUP, SIG_IGN);
328
329 serve_cache(socket_path, debug);
330 delete_tempfile(&socket_file);
331
332 return 0;
333}
334
335#else
336

Callers

nothing calls this directly

Calls 9

repo_config_get_boolFunction · 0.85
parse_optionsFunction · 0.85
usage_with_optionsFunction · 0.85
is_absolute_pathFunction · 0.85
init_socket_directoryFunction · 0.85
register_tempfileFunction · 0.85
serve_cacheFunction · 0.85
delete_tempfileFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected