|
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;
|
@@ -1623,6 +1624,11 @@ int git_default_core_config(const char *var, const char *value,
|
1623 | 1624 | return 0;
|
1624 | 1625 | }
|
1625 | 1626 |
|
| 1627 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1628 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1629 | + return 0; |
| 1630 | + } |
| 1631 | + |
1626 | 1632 | if (!strcmp(var, "core.sparsecheckout")) {
|
1627 | 1633 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1628 | 1634 | if (core_virtualfilesystem)
|
@@ -1774,6 +1780,37 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1774 | 1780 | return 0;
|
1775 | 1781 | }
|
1776 | 1782 |
|
| 1783 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1784 | +{ |
| 1785 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1786 | + char *v2 = NULL; |
| 1787 | + |
| 1788 | + if (!git_config_string(&v2, var, value) && v2 && *v2) { |
| 1789 | + free(gvfs_cache_server_url); |
| 1790 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1791 | + } |
| 1792 | + free(v2); |
| 1793 | + return 0; |
| 1794 | + } |
| 1795 | + |
| 1796 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1797 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1798 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1799 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1800 | + /* |
| 1801 | + * Pretend it wasn't set. This will cause us to |
| 1802 | + * fallback to ".git/objects" effectively. |
| 1803 | + */ |
| 1804 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1805 | + return 0; |
| 1806 | + } |
| 1807 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1808 | + return 0; |
| 1809 | + } |
| 1810 | + |
| 1811 | + return 0; |
| 1812 | +} |
| 1813 | + |
1777 | 1814 | static int git_default_attr_config(const char *var, const char *value)
|
1778 | 1815 | {
|
1779 | 1816 | if (!strcmp(var, "attr.tree")) {
|
@@ -1841,6 +1878,9 @@ int git_default_config(const char *var, const char *value,
|
1841 | 1878 | if (starts_with(var, "sparse."))
|
1842 | 1879 | return git_default_sparse_config(var, value);
|
1843 | 1880 |
|
| 1881 | + if (starts_with(var, "gvfs.")) |
| 1882 | + return git_default_gvfs_config(var, value); |
| 1883 | + |
1844 | 1884 | /* Add other config variables here and to Documentation/config.adoc. */
|
1845 | 1885 | return 0;
|
1846 | 1886 | }
|
|
0 commit comments