git/builtin/credential-cache.c

#include "builtin.h"
#include "credential.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
#include "strbuf.h"
#include "write-or-die.h"

#ifndef NO_UNIX_SOCKETS

#include "unix-socket.h"
#include "run-command.h"

#define FLAG_SPAWN
#define FLAG_RELAY

#ifdef GIT_WINDOWS_NATIVE

static int connection_closed(int error)
{
	return (error == EINVAL);
}

static int connection_fatally_broken(int error)
{
	return (error != ENOENT) && (error != ENETDOWN);
}

#else

static int connection_closed(int error)
{}

static int connection_fatally_broken(int error)
{}

#endif

static int send_request(const char *socket, const struct strbuf *out)
{}

static void spawn_daemon(const char *socket)
{}

static void do_cache(const char *socket, const char *action, int timeout,
		     int flags)
{}

static char *get_socket_path(void)
{}

static void announce_capabilities(void)
{}

int cmd_credential_cache(int argc,
			 const char **argv,
			 const char *prefix,
			 struct repository *repo UNUSED)
{}

#else

int cmd_credential_cache(int argc, const char **argv, const char *prefix)
{
	const char * const usage[] = {
		"git credential-cache [options] <action>",
		"",
		"credential-cache is disabled in this build of Git",
		NULL
	};
	struct option options[] = { OPT_END() };

	argc = parse_options(argc, argv, prefix, options, usage, 0);
	die(_("credential-cache unavailable; no unix socket support"));
}

#endif /* NO_UNIX_SOCKETS */