|
39 | 39 | #include "ws.h"
|
40 | 40 | #include "wrapper.h"
|
41 | 41 | #include "write-or-die.h"
|
| 42 | +#include "transport.h" |
42 | 43 |
|
43 | 44 | struct config_source {
|
44 | 45 | struct config_source *prev;
|
@@ -1820,6 +1821,11 @@ int git_default_core_config(const char *var, const char *value, void *cb)
|
1820 | 1821 | return 0;
|
1821 | 1822 | }
|
1822 | 1823 |
|
| 1824 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1825 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1826 | + return 0; |
| 1827 | + } |
| 1828 | + |
1823 | 1829 | if (!strcmp(var, "core.sparsecheckout")) {
|
1824 | 1830 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1825 | 1831 | if (core_virtualfilesystem)
|
@@ -1962,6 +1968,37 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1962 | 1968 | return 0;
|
1963 | 1969 | }
|
1964 | 1970 |
|
| 1971 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1972 | +{ |
| 1973 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1974 | + const char *v2 = NULL; |
| 1975 | + |
| 1976 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1977 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1978 | + free((char*)v2); |
| 1979 | + return 0; |
| 1980 | + } |
| 1981 | + |
| 1982 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1983 | + struct strbuf buf = STRBUF_INIT; |
| 1984 | + strbuf_addstr(&buf, value); |
| 1985 | + if (strbuf_normalize_path(&buf) < 0) { |
| 1986 | + /* |
| 1987 | + * Pretend it wasn't set. This will cause us to |
| 1988 | + * fallback to ".git/objects" effectively. |
| 1989 | + */ |
| 1990 | + strbuf_release(&buf); |
| 1991 | + return 0; |
| 1992 | + } |
| 1993 | + strbuf_trim_trailing_dir_sep(&buf); |
| 1994 | + |
| 1995 | + gvfs_shared_cache_pathname = strbuf_detach(&buf, NULL); |
| 1996 | + return 0; |
| 1997 | + } |
| 1998 | + |
| 1999 | + return 0; |
| 2000 | +} |
| 2001 | + |
1965 | 2002 | int git_default_config(const char *var, const char *value, void *cb)
|
1966 | 2003 | {
|
1967 | 2004 | if (starts_with(var, "core."))
|
@@ -2011,6 +2048,9 @@ int git_default_config(const char *var, const char *value, void *cb)
|
2011 | 2048 | if (starts_with(var, "sparse."))
|
2012 | 2049 | return git_default_sparse_config(var, value);
|
2013 | 2050 |
|
| 2051 | + if (starts_with(var, "gvfs.")) |
| 2052 | + return git_default_gvfs_config(var, value); |
| 2053 | + |
2014 | 2054 | /* Add other config variables here and to Documentation/config.txt. */
|
2015 | 2055 | return 0;
|
2016 | 2056 | }
|
|
0 commit comments