|
44 | 44 | #include "wildmatch.h" |
45 | 45 | #include "ws.h" |
46 | 46 | #include "write-or-die.h" |
| 47 | +#include "transport.h" |
47 | 48 |
|
48 | 49 | struct config_source { |
49 | 50 | struct config_source *prev; |
@@ -1628,6 +1629,11 @@ int git_default_core_config(const char *var, const char *value, |
1628 | 1629 | return 0; |
1629 | 1630 | } |
1630 | 1631 |
|
| 1632 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1633 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1634 | + return 0; |
| 1635 | + } |
| 1636 | + |
1631 | 1637 | if (!strcmp(var, "core.sparsecheckout")) { |
1632 | 1638 | /* virtual file system relies on the sparse checkout logic so force it on */ |
1633 | 1639 | if (core_virtualfilesystem) |
@@ -1779,6 +1785,37 @@ static int git_default_mailmap_config(const char *var, const char *value) |
1779 | 1785 | return 0; |
1780 | 1786 | } |
1781 | 1787 |
|
| 1788 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1789 | +{ |
| 1790 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1791 | + char *v2 = NULL; |
| 1792 | + |
| 1793 | + if (!git_config_string(&v2, var, value) && v2 && *v2) { |
| 1794 | + free(gvfs_cache_server_url); |
| 1795 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1796 | + } |
| 1797 | + free(v2); |
| 1798 | + return 0; |
| 1799 | + } |
| 1800 | + |
| 1801 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1802 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1803 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1804 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1805 | + /* |
| 1806 | + * Pretend it wasn't set. This will cause us to |
| 1807 | + * fallback to ".git/objects" effectively. |
| 1808 | + */ |
| 1809 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1810 | + return 0; |
| 1811 | + } |
| 1812 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1813 | + return 0; |
| 1814 | + } |
| 1815 | + |
| 1816 | + return 0; |
| 1817 | +} |
| 1818 | + |
1782 | 1819 | static int git_default_attr_config(const char *var, const char *value) |
1783 | 1820 | { |
1784 | 1821 | if (!strcmp(var, "attr.tree")) { |
@@ -1846,6 +1883,9 @@ int git_default_config(const char *var, const char *value, |
1846 | 1883 | if (starts_with(var, "sparse.")) |
1847 | 1884 | return git_default_sparse_config(var, value); |
1848 | 1885 |
|
| 1886 | + if (starts_with(var, "gvfs.")) |
| 1887 | + return git_default_gvfs_config(var, value); |
| 1888 | + |
1849 | 1889 | /* Add other config variables here and to Documentation/config.txt. */ |
1850 | 1890 | return 0; |
1851 | 1891 | } |
|
0 commit comments