PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAM_OBJS += bugreport.o
-PROGRAM_OBJS += credential-store.o
PROGRAM_OBJS += daemon.o
PROGRAM_OBJS += fast-import.o
PROGRAM_OBJS += http-backend.o
BUILTIN_OBJS += builtin/checkout.o
BUILTIN_OBJS += builtin/clean.o
BUILTIN_OBJS += builtin/clone.o
+BUILTIN_OBJS += builtin/credential-cache.o
+BUILTIN_OBJS += builtin/credential-cache--daemon.o
+BUILTIN_OBJS += builtin/credential-store.o
BUILTIN_OBJS += builtin/column.o
BUILTIN_OBJS += builtin/commit-graph.o
BUILTIN_OBJS += builtin/commit-tree.o
endif
ifdef NO_UNIX_SOCKETS
BASIC_CFLAGS += -DNO_UNIX_SOCKETS
- EXCLUDED_PROGRAMS += git-credential-cache git-credential-cache--daemon
else
LIB_OBJS += unix-socket.o
- PROGRAM_OBJS += credential-cache.o
- PROGRAM_OBJS += credential-cache--daemon.o
endif
ifdef NO_ICONV
# because it is just a copy/hardlink of git.exe, rather than a unique binary.
$(INSTALL) git.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) git-shell.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
- $(INSTALL) git-credential-store.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-daemon.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-fast-import.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-http-backend.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
int cmd_config(int argc, const char **argv, const char *prefix);
int cmd_count_objects(int argc, const char **argv, const char *prefix);
int cmd_credential(int argc, const char **argv, const char *prefix);
+int cmd_credential_cache(int argc, const char **argv, const char *prefix);
+int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix);
+int cmd_credential_store(int argc, const char **argv, const char *prefix);
int cmd_describe(int argc, const char **argv, const char *prefix);
int cmd_diff_files(int argc, const char **argv, const char *prefix);
int cmd_diff_index(int argc, const char **argv, const char *prefix);
-#include "cache.h"
+#include "builtin.h"
+#include "parse-options.h"
+
+#ifndef NO_UNIX_SOCKETS
+
#include "config.h"
#include "tempfile.h"
#include "credential.h"
#include "unix-socket.h"
-#include "parse-options.h"
struct credential_cache_entry {
struct credential item;
free(path_copy);
}
-int cmd_main(int argc, const char **argv)
+int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
{
struct tempfile *socket_file;
const char *socket_path;
git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
- argc = parse_options(argc, argv, NULL, options, usage, 0);
+ argc = parse_options(argc, argv, prefix, options, usage, 0);
socket_path = argv[0];
if (!socket_path)
return 0;
}
+
+#else
+
+int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
+{
+ const char * const usage[] = {
+ "git credential-cache--daemon [options] <action>",
+ "",
+ "credential-cache--daemon 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--daemon unavailable; no unix socket support"));
+}
+
+#endif /* NO_UNIX_SOCKET */
-#include "cache.h"
+#include "builtin.h"
+#include "parse-options.h"
+
+#ifndef NO_UNIX_SOCKETS
+
#include "credential.h"
#include "string-list.h"
-#include "parse-options.h"
#include "unix-socket.h"
#include "run-command.h"
return socket;
}
-int cmd_main(int argc, const char **argv)
+int cmd_credential_cache(int argc, const char **argv, const char *prefix)
{
char *socket_path = NULL;
int timeout = 900;
OPT_END()
};
- argc = parse_options(argc, argv, NULL, options, usage, 0);
+ argc = parse_options(argc, argv, prefix, options, usage, 0);
if (!argc)
usage_with_options(usage, options);
op = argv[0];
return 0;
}
+
+#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 */
-#include "cache.h"
+#include "builtin.h"
#include "lockfile.h"
#include "credential.h"
#include "string-list.h"
return; /* Found credential */
}
-int cmd_main(int argc, const char **argv)
+int cmd_credential_store(int argc, const char **argv, const char *prefix)
{
const char * const usage[] = {
"git credential-store [<options>] <action>",
umask(077);
- argc = parse_options(argc, (const char **)argv, NULL, options, usage, 0);
+ argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
if (argc != 1)
usage_with_options(usage, options);
op = argv[0];
#programs
set(PROGRAMS_BUILT
- git git-bugreport git-credential-store git-daemon git-fast-import git-http-backend git-sh-i18n--envsubst
+ git git-bugreport git-daemon git-fast-import git-http-backend git-sh-i18n--envsubst
git-shell git-remote-testsvn)
-if(NO_UNIX_SOCKETS)
- list(APPEND excluded_progs git-credential-cache git-credential-cache--daemon)
-else()
- list(APPEND PROGRAMS_BUILT git-credential-cache git-credential-cache--daemon)
-endif()
-
if(NOT CURL_FOUND)
list(APPEND excluded_progs git-http-fetch git-http-push)
add_compile_definitions(NO_CURL)
add_executable(git-bugreport ${CMAKE_SOURCE_DIR}/bugreport.c)
target_link_libraries(git-bugreport common-main)
-add_executable(git-credential-store ${CMAKE_SOURCE_DIR}/credential-store.c)
-target_link_libraries(git-credential-store common-main)
-
add_executable(git-daemon ${CMAKE_SOURCE_DIR}/daemon.c)
target_link_libraries(git-daemon common-main)
add_executable(git-remote-testsvn ${CMAKE_SOURCE_DIR}/remote-testsvn.c)
target_link_libraries(git-remote-testsvn common-main vcs-svn)
-if(NOT NO_UNIX_SOCKETS)
- add_executable(git-credential-cache ${CMAKE_SOURCE_DIR}/credential-cache.c)
- target_link_libraries(git-credential-cache common-main)
-
- add_executable(git-credential-cache--daemon ${CMAKE_SOURCE_DIR}/credential-cache--daemon.c)
- target_link_libraries(git-credential-cache--daemon common-main)
-endif()
-
-
set(git_builtin_extra
cherry cherry-pick format-patch fsck-objects
init merge-subtree restore show
{ "config", cmd_config, RUN_SETUP_GENTLY | DELAY_PAGER_CONFIG },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "credential", cmd_credential, RUN_SETUP_GENTLY | NO_PARSEOPT },
+ { "credential-cache", cmd_credential_cache },
+ { "credential-cache--daemon", cmd_credential_cache_daemon },
+ { "credential-store", cmd_credential_store },
{ "describe", cmd_describe, RUN_SETUP },
{ "diff", cmd_diff, NO_PARSEOPT },
{ "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },