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