|
22 | 22 | #include "dir.h"
|
23 | 23 | #include "color.h"
|
24 | 24 | #include "refs.h"
|
| 25 | +#include "transport.h" |
25 | 26 |
|
26 | 27 | struct config_source {
|
27 | 28 | struct config_source *prev;
|
@@ -1548,6 +1549,11 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
|
1548 | 1549 | return 0;
|
1549 | 1550 | }
|
1550 | 1551 |
|
| 1552 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1553 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1554 | + return 0; |
| 1555 | + } |
| 1556 | + |
1551 | 1557 | if (!strcmp(var, "core.sparsecheckout")) {
|
1552 | 1558 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1553 | 1559 | if (core_virtualfilesystem)
|
@@ -1673,6 +1679,35 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1673 | 1679 | return 0;
|
1674 | 1680 | }
|
1675 | 1681 |
|
| 1682 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1683 | +{ |
| 1684 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1685 | + const char *v2 = NULL; |
| 1686 | + |
| 1687 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1688 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1689 | + free((char*)v2); |
| 1690 | + return 0; |
| 1691 | + } |
| 1692 | + |
| 1693 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1694 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1695 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1696 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1697 | + /* |
| 1698 | + * Pretend it wasn't set. This will cause us to |
| 1699 | + * fallback to ".git/objects" effectively. |
| 1700 | + */ |
| 1701 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1702 | + return 0; |
| 1703 | + } |
| 1704 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1705 | + return 0; |
| 1706 | + } |
| 1707 | + |
| 1708 | + return 0; |
| 1709 | +} |
| 1710 | + |
1676 | 1711 | int git_default_config(const char *var, const char *value, void *cb)
|
1677 | 1712 | {
|
1678 | 1713 | if (starts_with(var, "core."))
|
@@ -1719,6 +1754,9 @@ int git_default_config(const char *var, const char *value, void *cb)
|
1719 | 1754 | return 0;
|
1720 | 1755 | }
|
1721 | 1756 |
|
| 1757 | + if (starts_with(var, "gvfs.")) |
| 1758 | + return git_default_gvfs_config(var, value); |
| 1759 | + |
1722 | 1760 | /* Add other config variables here and to Documentation/config.txt. */
|
1723 | 1761 | return 0;
|
1724 | 1762 | }
|
|
0 commit comments