|
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;
|
@@ -1534,6 +1535,11 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
|
1534 | 1535 | return 0;
|
1535 | 1536 | }
|
1536 | 1537 |
|
| 1538 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1539 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1540 | + return 0; |
| 1541 | + } |
| 1542 | + |
1537 | 1543 | if (!strcmp(var, "core.sparsecheckout")) {
|
1538 | 1544 | /* virtual file system relies on the sparse checkout logic so force it on */
|
1539 | 1545 | if (core_virtualfilesystem)
|
@@ -1659,6 +1665,35 @@ static int git_default_mailmap_config(const char *var, const char *value)
|
1659 | 1665 | return 0;
|
1660 | 1666 | }
|
1661 | 1667 |
|
| 1668 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1669 | +{ |
| 1670 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1671 | + const char *v2 = NULL; |
| 1672 | + |
| 1673 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1674 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1675 | + free((char*)v2); |
| 1676 | + return 0; |
| 1677 | + } |
| 1678 | + |
| 1679 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1680 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1681 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1682 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1683 | + /* |
| 1684 | + * Pretend it wasn't set. This will cause us to |
| 1685 | + * fallback to ".git/objects" effectively. |
| 1686 | + */ |
| 1687 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1688 | + return 0; |
| 1689 | + } |
| 1690 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1691 | + return 0; |
| 1692 | + } |
| 1693 | + |
| 1694 | + return 0; |
| 1695 | +} |
| 1696 | + |
1662 | 1697 | int git_default_config(const char *var, const char *value, void *cb)
|
1663 | 1698 | {
|
1664 | 1699 | if (starts_with(var, "core."))
|
@@ -1705,6 +1740,9 @@ int git_default_config(const char *var, const char *value, void *cb)
|
1705 | 1740 | return 0;
|
1706 | 1741 | }
|
1707 | 1742 |
|
| 1743 | + if (starts_with(var, "gvfs.")) |
| 1744 | + return git_default_gvfs_config(var, value); |
| 1745 | + |
1708 | 1746 | /* Add other config variables here and to Documentation/config.txt. */
|
1709 | 1747 | return 0;
|
1710 | 1748 | }
|
|
0 commit comments