|
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,37 @@ 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 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1802 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1803 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1804 | + /* |
| 1805 | + * Pretend it wasn't set. This will cause us to |
| 1806 | + * fallback to ".git/objects" effectively. |
| 1807 | + */ |
| 1808 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1809 | + return 0; |
| 1810 | + } |
| 1811 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1812 | + return 0; |
| 1813 | + } |
| 1814 | + |
| 1815 | + return 0; |
| 1816 | +} |
| 1817 | + |
1781 | 1818 | static int git_default_attr_config(const char *var, const char *value)
|
1782 | 1819 | {
|
1783 | 1820 | if (!strcmp(var, "attr.tree")) {
|
@@ -1845,6 +1882,9 @@ int git_default_config(const char *var, const char *value,
|
1845 | 1882 | if (starts_with(var, "sparse."))
|
1846 | 1883 | return git_default_sparse_config(var, value);
|
1847 | 1884 |
|
| 1885 | + if (starts_with(var, "gvfs.")) |
| 1886 | + return git_default_gvfs_config(var, value); |
| 1887 | + |
1848 | 1888 | /* Add other config variables here and to Documentation/config.txt. */
|
1849 | 1889 | return 0;
|
1850 | 1890 | }
|
|
0 commit comments