|
21 | 21 | #include "color.h" |
22 | 22 | #include "refs.h" |
23 | 23 | #include "gvfs.h" |
| 24 | +#include "transport.h" |
24 | 25 |
|
25 | 26 | struct config_source { |
26 | 27 | struct config_source *prev; |
@@ -1380,6 +1381,11 @@ static int git_default_core_config(const char *var, const char *value, void *cb) |
1380 | 1381 | return 0; |
1381 | 1382 | } |
1382 | 1383 |
|
| 1384 | + if (!strcmp(var, "core.usegvfshelper")) { |
| 1385 | + core_use_gvfs_helper = git_config_bool(var, value); |
| 1386 | + return 0; |
| 1387 | + } |
| 1388 | + |
1383 | 1389 | if (!strcmp(var, "core.sparsecheckout")) { |
1384 | 1390 | /* virtual file system relies on the sparse checkout logic so force it on */ |
1385 | 1391 | if (core_virtualfilesystem) |
@@ -1505,6 +1511,35 @@ static int git_default_mailmap_config(const char *var, const char *value) |
1505 | 1511 | return 0; |
1506 | 1512 | } |
1507 | 1513 |
|
| 1514 | +static int git_default_gvfs_config(const char *var, const char *value) |
| 1515 | +{ |
| 1516 | + if (!strcmp(var, "gvfs.cache-server")) { |
| 1517 | + const char *v2 = NULL; |
| 1518 | + |
| 1519 | + if (!git_config_string(&v2, var, value) && v2 && *v2) |
| 1520 | + gvfs_cache_server_url = transport_anonymize_url(v2); |
| 1521 | + free((char*)v2); |
| 1522 | + return 0; |
| 1523 | + } |
| 1524 | + |
| 1525 | + if (!strcmp(var, "gvfs.sharedcache") && value && *value) { |
| 1526 | + strbuf_setlen(&gvfs_shared_cache_pathname, 0); |
| 1527 | + strbuf_addstr(&gvfs_shared_cache_pathname, value); |
| 1528 | + if (strbuf_normalize_path(&gvfs_shared_cache_pathname) < 0) { |
| 1529 | + /* |
| 1530 | + * Pretend it wasn't set. This will cause us to |
| 1531 | + * fallback to ".git/objects" effectively. |
| 1532 | + */ |
| 1533 | + strbuf_release(&gvfs_shared_cache_pathname); |
| 1534 | + return 0; |
| 1535 | + } |
| 1536 | + strbuf_trim_trailing_dir_sep(&gvfs_shared_cache_pathname); |
| 1537 | + return 0; |
| 1538 | + } |
| 1539 | + |
| 1540 | + return 0; |
| 1541 | +} |
| 1542 | + |
1508 | 1543 | int git_default_config(const char *var, const char *value, void *cb) |
1509 | 1544 | { |
1510 | 1545 | if (starts_with(var, "core.")) |
@@ -1551,6 +1586,9 @@ int git_default_config(const char *var, const char *value, void *cb) |
1551 | 1586 | return 0; |
1552 | 1587 | } |
1553 | 1588 |
|
| 1589 | + if (starts_with(var, "gvfs.")) |
| 1590 | + return git_default_gvfs_config(var, value); |
| 1591 | + |
1554 | 1592 | /* Add other config variables here and to Documentation/config.txt. */ |
1555 | 1593 | return 0; |
1556 | 1594 | } |
|
0 commit comments