|
42 | 42 | #include "wildmatch.h"
|
43 | 43 | #include "ws.h"
|
44 | 44 | #include "write-or-die.h"
|
| 45 | +#include "transport.h" |
45 | 46 |
|
46 | 47 | struct config_source {
|
47 | 48 | struct config_source *prev;
|
@@ -1671,6 +1672,11 @@ int git_default_core_config(const char *var, const char *value,
|
1671 | 1672 | return 0;
|
1672 | 1673 | }
|
1673 | 1674 |
|
| 1675 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1676 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1677 | + return 0; |
| 1678 | + } |
| 1679 | + |
1674 | 1680 | if (!strcmp(var, "core.sparsecheckout")) {
|
1675 | 1681 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1676 | 1682 | if (core_virtualfilesystem)
|
@@ -1822,6 +1828,37 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1822 | 1828 | return 0;
|
1823 | 1829 | }
|
1824 | 1830 |
|
| 1831 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1832 | +{ |
| 1833 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1834 | + char *v2 = NULL; |
| 1835 | + |
| 1836 | + if (!git_config_string(&v2, var, value) && v2 && *v2) { |
| 1837 | + free(gvfs_cache_server_url); |
| 1838 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1839 | + } |
| 1840 | + free(v2); |
| 1841 | + return 0; |
| 1842 | + } |
| 1843 | + |
| 1844 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1845 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1846 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1847 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1848 | + /* |
| 1849 | + * Pretend it wasn't set. This will cause us to |
| 1850 | + * fallback to ".git/objects" effectively. |
| 1851 | + */ |
| 1852 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1853 | + return 0; |
| 1854 | + } |
| 1855 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1856 | + return 0; |
| 1857 | + } |
| 1858 | + |
| 1859 | + return 0; |
| 1860 | +} |
| 1861 | + |
1825 | 1862 | static int git_default_attr_config(const char *var, const char *value)
|
1826 | 1863 | {
|
1827 | 1864 | if (!strcmp(var, "attr.tree")) {
|
@@ -1889,6 +1926,9 @@ int git_default_config(const char *var, const char *value,
|
1889 | 1926 | if (starts_with(var, "sparse."))
|
1890 | 1927 | return git_default_sparse_config(var, value);
|
1891 | 1928 |
|
| 1929 | + if (starts_with(var, "gvfs.")) |
| 1930 | + return git_default_gvfs_config(var, value); |
| 1931 | + |
1892 | 1932 | /* Add other config variables here and to Documentation/config.txt. */
|
1893 | 1933 | return 0;
|
1894 | 1934 | }
|
|
0 commit comments