|
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; |
@@ -1618,6 +1619,11 @@ int git_default_core_config(const char *var, const char *value, |
1618 | 1619 | return 0; |
1619 | 1620 | } |
1620 | 1621 |
|
| 1622 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1623 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1624 | + return 0; |
| 1625 | + } |
| 1626 | + |
1621 | 1627 | if (!strcmp(var, "core.sparsecheckout")) { |
1622 | 1628 | /* virtual file system relies on the sparse checkout logic so force it on */ |
1623 | 1629 | if (core_virtualfilesystem) |
@@ -1769,6 +1775,37 @@ static int git_default_mailmap_config(const char *var, const char *value) |
1769 | 1775 | return 0; |
1770 | 1776 | } |
1771 | 1777 |
|
| 1778 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1779 | +{ |
| 1780 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1781 | + char *v2 = NULL; |
| 1782 | + |
| 1783 | + if (!git_config_string(&v2, var, value) && v2 && *v2) { |
| 1784 | + free(gvfs_cache_server_url); |
| 1785 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1786 | + } |
| 1787 | + free(v2); |
| 1788 | + return 0; |
| 1789 | + } |
| 1790 | + |
| 1791 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1792 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1793 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1794 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1795 | + /* |
| 1796 | + * Pretend it wasn't set. This will cause us to |
| 1797 | + * fallback to ".git/objects" effectively. |
| 1798 | + */ |
| 1799 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1800 | + return 0; |
| 1801 | + } |
| 1802 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1803 | + return 0; |
| 1804 | + } |
| 1805 | + |
| 1806 | + return 0; |
| 1807 | +} |
| 1808 | + |
1772 | 1809 | static int git_default_attr_config(const char *var, const char *value) |
1773 | 1810 | { |
1774 | 1811 | if (!strcmp(var, "attr.tree")) { |
@@ -1836,6 +1873,9 @@ int git_default_config(const char *var, const char *value, |
1836 | 1873 | if (starts_with(var, "sparse.")) |
1837 | 1874 | return git_default_sparse_config(var, value); |
1838 | 1875 |
|
| 1876 | + if (starts_with(var, "gvfs.")) |
| 1877 | + return git_default_gvfs_config(var, value); |
| 1878 | + |
1839 | 1879 | /* Add other config variables here and to Documentation/config.adoc. */ |
1840 | 1880 | return 0; |
1841 | 1881 | } |
|
0 commit comments