Merge branch 'np/credential-cache-sighup'

Workaround for using credential-cache with emacs.

* np/credential-cache-sighup:
  credential-cache: new option to ignore sighup
This commit is contained in:
Junio C Hamano 2015-12-04 11:19:11 -08:00
Родитель 2d808073db 7f4d4746c1
Коммит 3a5b6eeceb
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -1122,6 +1122,9 @@ credential.<url>.*::
example.com. See linkgit:gitcredentials[7] for details on how URLs are
matched.
credentialCache.ignoreSIGHUP::
Tell git-credential-cache--daemon to ignore SIGHUP, instead of quitting.
include::diff-config.txt[]
difftool.<tool>.path::

Просмотреть файл

@ -244,6 +244,7 @@ static void check_socket_directory(const char *path)
int main(int argc, const char **argv)
{
const char *socket_path;
int ignore_sighup = 0;
static const char *usage[] = {
"git-credential-cache--daemon [opts] <socket_path>",
NULL
@ -255,6 +256,8 @@ int main(int argc, const char **argv)
OPT_END()
};
git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
argc = parse_options(argc, argv, NULL, options, usage, 0);
socket_path = argv[0];
@ -263,6 +266,10 @@ int main(int argc, const char **argv)
check_socket_directory(socket_path);
register_tempfile(&socket_file, socket_path);
if (ignore_sighup)
signal(SIGHUP, SIG_IGN);
serve_cache(socket_path, debug);
delete_tempfile(&socket_file);