| 289 | } |
| 290 | |
| 291 | int 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 |
nothing calls this directly
no test coverage detected