|
27 | 27 | #include "branch.h" |
28 | 28 | #include "promisor-remote.h" |
29 | 29 | #include "commit-graph.h" |
| 30 | +#include "gvfs.h" |
| 31 | +#include "gvfs-helper-client.h" |
30 | 32 |
|
31 | 33 | #define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000) |
32 | 34 |
|
@@ -78,6 +80,7 @@ static struct list_objects_filter_options filter_options; |
78 | 80 | static struct string_list server_options = STRING_LIST_INIT_DUP; |
79 | 81 | static struct string_list negotiation_tip = STRING_LIST_INIT_NODUP; |
80 | 82 | static int fetch_write_commit_graph = -1; |
| 83 | +static int update_remote_refs = 1; |
81 | 84 |
|
82 | 85 | static int git_fetch_config(const char *k, const char *v, void *cb) |
83 | 86 | { |
@@ -201,6 +204,8 @@ static struct option builtin_fetch_options[] = { |
201 | 204 | N_("check for forced-updates on all updated branches")), |
202 | 205 | OPT_BOOL(0, "write-commit-graph", &fetch_write_commit_graph, |
203 | 206 | N_("write the commit-graph after fetching")), |
| 207 | + OPT_BOOL(0, "update-remote-refs", &update_remote_refs, |
| 208 | + N_("update the refs/remotes/ refspace")), |
204 | 209 | OPT_END() |
205 | 210 | }; |
206 | 211 |
|
@@ -746,6 +751,9 @@ static int update_local_ref(struct ref *ref, |
746 | 751 | const char *pretty_ref = prettify_refname(ref->name); |
747 | 752 | int fast_forward = 0; |
748 | 753 |
|
| 754 | + if (!update_remote_refs && starts_with(ref->name, "refs/remotes/")) |
| 755 | + return 0; |
| 756 | + |
749 | 757 | type = oid_object_info(the_repository, &ref->new_oid, NULL); |
750 | 758 | if (type < 0) |
751 | 759 | die(_("object %s not found"), oid_to_hex(&ref->new_oid)); |
@@ -1821,6 +1829,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) |
1821 | 1829 | } |
1822 | 1830 | } |
1823 | 1831 |
|
| 1832 | + if (core_gvfs & GVFS_PREFETCH_DURING_FETCH) |
| 1833 | + gh_client__prefetch(0, NULL); |
| 1834 | + |
1824 | 1835 | if (remote) { |
1825 | 1836 | if (filter_options.choice || has_promisor_remote()) |
1826 | 1837 | fetch_one_setup_partial(remote); |
|
0 commit comments