|
24 | 24 | #include "color.h"
|
25 | 25 | #include "refs.h"
|
26 | 26 | #include "worktree.h"
|
| 27 | +#include "transport.h" |
27 | 28 |
|
28 | 29 | struct config_source {
|
29 | 30 | struct config_source *prev;
|
@@ -1723,6 +1724,11 @@ int git_default_core_config(const char *var, const char *value, void *cb)
|
1723 | 1724 | return 0;
|
1724 | 1725 | }
|
1725 | 1726 |
|
| 1727 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1728 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1729 | + return 0; |
| 1730 | + } |
| 1731 | + |
1726 | 1732 | if (!strcmp(var, "core.sparsecheckout")) {
|
1727 | 1733 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1728 | 1734 | if (core_virtualfilesystem)
|
@@ -1865,6 +1871,35 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1865 | 1871 | return 0;
|
1866 | 1872 | }
|
1867 | 1873 |
|
| 1874 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1875 | +{ |
| 1876 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1877 | + const char *v2 = NULL; |
| 1878 | + |
| 1879 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1880 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1881 | + free((char*)v2); |
| 1882 | + return 0; |
| 1883 | + } |
| 1884 | + |
| 1885 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1886 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1887 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1888 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1889 | + /* |
| 1890 | + * Pretend it wasn't set. This will cause us to |
| 1891 | + * fallback to ".git/objects" effectively. |
| 1892 | + */ |
| 1893 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1894 | + return 0; |
| 1895 | + } |
| 1896 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1897 | + return 0; |
| 1898 | + } |
| 1899 | + |
| 1900 | + return 0; |
| 1901 | +} |
| 1902 | + |
1868 | 1903 | int git_default_config(const char *var, const char *value, void *cb)
|
1869 | 1904 | {
|
1870 | 1905 | if (starts_with(var, "core."))
|
@@ -1914,6 +1949,9 @@ int git_default_config(const char *var, const char *value, void *cb)
|
1914 | 1949 | if (starts_with(var, "sparse."))
|
1915 | 1950 | return git_default_sparse_config(var, value);
|
1916 | 1951 |
|
| 1952 | + if (starts_with(var, "gvfs.")) |
| 1953 | + return git_default_gvfs_config(var, value); |
| 1954 | + |
1917 | 1955 | /* Add other config variables here and to Documentation/config.txt. */
|
1918 | 1956 | return 0;
|
1919 | 1957 | }
|
|
0 commit comments