|
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; |
@@ -1735,6 +1736,11 @@ int git_default_core_config(const char *var, const char *value, void *cb) |
1735 | 1736 | return 0; |
1736 | 1737 | } |
1737 | 1738 |
|
| 1739 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1740 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1741 | + return 0; |
| 1742 | + } |
| 1743 | + |
1738 | 1744 | if (!strcmp(var, "core.sparsecheckout")) { |
1739 | 1745 | /* virtual file system relies on the sparse checkout logic so force it on */ |
1740 | 1746 | if (core_virtualfilesystem) |
@@ -1877,6 +1883,37 @@ static int git_default_mailmap_config(const char *var, const char *value) |
1877 | 1883 | return 0; |
1878 | 1884 | } |
1879 | 1885 |
|
| 1886 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1887 | +{ |
| 1888 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1889 | + const char *v2 = NULL; |
| 1890 | + |
| 1891 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1892 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1893 | + free((char*)v2); |
| 1894 | + return 0; |
| 1895 | + } |
| 1896 | + |
| 1897 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1898 | + struct strbuf buf = STRBUF_INIT; |
| 1899 | + strbuf_addstr(&buf, value); |
| 1900 | + if (strbuf_normalize_path(&buf) < 0) { |
| 1901 | + /* |
| 1902 | + * Pretend it wasn't set. This will cause us to |
| 1903 | + * fallback to ".git/objects" effectively. |
| 1904 | + */ |
| 1905 | + strbuf_release(&buf); |
| 1906 | + return 0; |
| 1907 | + } |
| 1908 | + strbuf_trim_trailing_dir_sep(&buf); |
| 1909 | + |
| 1910 | + gvfs_shared_cache_pathname = strbuf_detach(&buf, NULL); |
| 1911 | + return 0; |
| 1912 | + } |
| 1913 | + |
| 1914 | + return 0; |
| 1915 | +} |
| 1916 | + |
1880 | 1917 | int git_default_config(const char *var, const char *value, void *cb) |
1881 | 1918 | { |
1882 | 1919 | if (starts_with(var, "core.")) |
@@ -1926,6 +1963,9 @@ int git_default_config(const char *var, const char *value, void *cb) |
1926 | 1963 | if (starts_with(var, "sparse.")) |
1927 | 1964 | return git_default_sparse_config(var, value); |
1928 | 1965 |
|
| 1966 | + if (starts_with(var, "gvfs.")) |
| 1967 | + return git_default_gvfs_config(var, value); |
| 1968 | + |
1929 | 1969 | /* Add other config variables here and to Documentation/config.txt. */ |
1930 | 1970 | return 0; |
1931 | 1971 | } |
|
0 commit comments