|
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;
|
@@ -1648,6 +1649,11 @@ int git_default_core_config(const char *var, const char *value,
|
1648 | 1649 | return 0;
|
1649 | 1650 | }
|
1650 | 1651 |
|
| 1652 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1653 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1654 | + return 0; |
| 1655 | + } |
| 1656 | + |
1651 | 1657 | if (!strcmp(var, "core.sparsecheckout")) {
|
1652 | 1658 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1653 | 1659 | if (core_virtualfilesystem)
|
@@ -1799,6 +1805,37 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1799 | 1805 | return 0;
|
1800 | 1806 | }
|
1801 | 1807 |
|
| 1808 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1809 | +{ |
| 1810 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1811 | + char *v2 = NULL; |
| 1812 | + |
| 1813 | + if (!git_config_string(&v2, var, value) && v2 && *v2) { |
| 1814 | + free(gvfs_cache_server_url); |
| 1815 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1816 | + } |
| 1817 | + free(v2); |
| 1818 | + return 0; |
| 1819 | + } |
| 1820 | + |
| 1821 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1822 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1823 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1824 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1825 | + /* |
| 1826 | + * Pretend it wasn't set. This will cause us to |
| 1827 | + * fallback to ".git/objects" effectively. |
| 1828 | + */ |
| 1829 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1830 | + return 0; |
| 1831 | + } |
| 1832 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1833 | + return 0; |
| 1834 | + } |
| 1835 | + |
| 1836 | + return 0; |
| 1837 | +} |
| 1838 | + |
1802 | 1839 | static int git_default_attr_config(const char *var, const char *value)
|
1803 | 1840 | {
|
1804 | 1841 | if (!strcmp(var, "attr.tree")) {
|
@@ -1866,6 +1903,9 @@ int git_default_config(const char *var, const char *value,
|
1866 | 1903 | if (starts_with(var, "sparse."))
|
1867 | 1904 | return git_default_sparse_config(var, value);
|
1868 | 1905 |
|
| 1906 | + if (starts_with(var, "gvfs.")) |
| 1907 | + return git_default_gvfs_config(var, value); |
| 1908 | + |
1869 | 1909 | /* Add other config variables here and to Documentation/config.txt. */
|
1870 | 1910 | return 0;
|
1871 | 1911 | }
|
|
0 commit comments